Configuring Atmosphere for Performance - Atmosphere/atmosphere Wiki

Use this only with 1.0.12 and lower. With 1.0.12 and higher, it is recommend to not change anything.

Configuring your application to get the best performance of Atmosphere can be a difficult task. Please make sure you understand what is a Broadcaster before reading this document.

The first decision to make when configuring Atmosphere is to associate a Broadcaster with its own Thread Pool (ExecutorService) or use a single one, shared amongst the set of Broadcaster your application will create.

The second decision to make is to answer the following question: is message order important? Stated differently, does the order of invoking


is important for your application or not.

By default, the order is guarantee, e.g invoking


will be received by the client as:


If your application doesn't need to enforce messages order, you may want to disable the mechanism as it significantly improve the performance of messages delivery.

First, disable the mechanism by doing


Next, make sure you change the default Thread Pool that ship with Atmosphere as you may run out of memory, as the Thread pool is unbounded. Just set: To configure the maximum threads created by the Broadcaster of the message delivery, just add


and for the one used for the write operation,


That could significantly improve the performance of your application.