Multi-core performance

We have a new test machine with 8 cores(dual 4-core). I’d like to understand whether OpenFire will utilize this setup much.

Our main usage pattern is multi-user chat rooms used as channels. Ie we have about 10-50 rooms going at once distributing simulation and telemetry data streams. They will have anywhere from 3-100 users on the muc, with stream traffic from 1-100HZ data.

A look at the source code makes me think it won’t utilitize the multiple cores much.

Sould I look at inter-core clustering to utilize this machine, or do you think the code will utilize the cores effectively.

The distribution code for a MUC seems to wait for a send on each client. A slow client will likely make the latency high for the whole room. I’m considering prototyping a delivery mechanism with a pool of threads that service a room. Is anyone working on something like this or has it been tried and found to be problematic?

Multi-threaded java code should be able to take advantage multiple cores/cpus, and openfire does use multiple threads.

It can but it must be coded to use it. In this case the MucRoom implementation doesn’t seem to. I was hoping one of the developers could comment on whether the internals are thread safe. Or do users typically run multiple instances on OpenFire to multi-thread. Ie have the rooms share content but run one instance per core. Some overhead to sync the cores but likely would allow for more simultaneous users.

I believe Openfire already does utilize multiple cores. It has internal ThreadPools used to service incoming and outgoing traffic, and uses the MINA framework ( for asynchronous I/O.

We run an Openfire setup which is exclusively used for MUC on a dual-core box, and with 100-200 users per room we have reached a peak of 12,000 concurrent users with no problems.

Hey Alan,

As it was already mentioned, Openfire will do take advantage of a multi-core CPU. You may want to experiment with different GC algorithms based on your setup to achieve maximum performance.

Regarding sending messages to room occupants even though you saw a nice loop to broadcast a message to room occupants that does not mean that the server will wait to actually deliver each message. Openfire uses MINA and that applies both for reading and writing data to/from the sockets. MINA uses an incoming and also an outgoing queue so when Openfire wants to send something to a client the packet is actually stored in an outgoing queue. MINA will take care of sending the packet to the client.


– Gato

Ah, that explains it. Didn’t trace the calls deep enough.

Thanks again