twonds / punjab

BOSH connection manager
MIT License
183 stars 49 forks source link

Punjab performance with openfire #28

Closed amolkul closed 11 years ago

amolkul commented 11 years ago

Hello,

I'm doing a benchmark test of openfire+bosh. I'm comparing punjab vs openfire built-in connection manager. Following is my test setup :

Server : VirtualBox VM running RHEL 6.0 with 2 cpu + 2 gb ram. Client : VirtualBox VM running CentOS 6.0 Hardware : Desktop Intel 64 bit - i3, 16gb ram ( client and server are run on different physical servers) Test tool : tsung Total number of users : 10000 Testing for users : 300 Number of contacts in each user's roster : 1000 Testing process : 300 users login via bosh at a rate of 120/second. Then they come online - i.e presence. For presence there is no rate defined.

The test results are quite unexpected. Openfire builtin connection manager : About 250 users manage to login and come online. Punjab (using use_raw) : About 200 users manage to login.

Actually we were expecting that punjab will give us much better performance than Openfire built in connection manager.

Is the above test showing correct result - or am I missing something ? Is there any performance tuning other than use_raw for punjab?

Thanks in advance, Amol

twonds commented 11 years ago

That does seem low. Memory can be a big issue with Punjab. Is Punjab on the same machine as openfire? Also, use_raw only improves xml serialization rates and will use more memory. What differences do you see without use_raw? Also, what is the difference without using any BOSH?

I will say that its typically not ideal to use Punjab when you have a local bosh connection manager in the server and are only gonna be connecting to that server.

amolkul commented 11 years ago

Actually the problem turned out to be bcos of the apache http proxy. When I did direct connections to punjab I could get good results. As per your reco I will not use punjab with openfire, but I do have a jabberd2 server also. Do you know any document for performance tuning of apache http proxy for bosh? I could find generic documents for apache but if any document for apache + bosh exists then it will save me lot of time. Thanks.

twonds commented 11 years ago

I would recommend not using apache. I would use nginx or a load balancer of some kind.

amolkul commented 11 years ago

Just completed testing with nginx. The setup is working well for basic performance and functionality tests. Earlier it was not able to complete the basic performance test. Now we have nginx + punjab + jabberd and 300 users login and do 1 presence transaction. The login rate is 120/sec.

But I'm a little concerned about memory usage of Punjab. Is there any indicative measure for this - like for 1000 concurrent connections how much memory would it take ? Does the memory usage grow with time time ?

twonds commented 11 years ago

Memory should be measurable by each client connection. It doesn't grow over time just with users. I do not know the amount of memory each connection takes or 1k either. You will have to test.

amolkul commented 11 years ago

Ok thanks.