Skip to content

Improving Performance by using the PoolableBroadcasterFactory

Jeanfrancois Arcand edited this page Feb 26, 2015 · 5 revisions

PoolableBroadcasterFactory (2.3.0+)

The DefaultBroadcasterFactory keeps a reference to all created Broadcaster, and for some applications that heavily creates new Broadcaster that operation can cause performance issue. If your application creates a lot of Broadcaster, you can take a look at the PoolableBroadcasterFactory, which can be used to significatly improve throughput of an application. By default, Appache Common Pool2 is used so you need to add

  <groupId>org.apache.commons</groupId>
  <artifactId>commons-pool2</artifactId>
  <version>2.3</version>

Next, in your web.xml, define:

<init-param>
    <param-name>org.atmosphere.cpr.broadcasterFactory</param-name>
    <param-value>org.atmosphere.pool.PoolableBroadcasterFactory</param-value>
</init-param>

By default the PoolableBroadcastFactory uses an unbounded Apache commons-pool2 implementation. There is also a bounded version.

You can configure or define your own pool by adding in web.xml:

<init-param>
    <param-name>org.atmosphere.pool.poolableProvider</param-name>
    <param-value>your class that implement org.atmosphere.pool.PoolableProvider</param-value>
</init-param>

The complete implementation can be found here

Step by Step Tutorials

Concepts & Architecture

15 Minutes Tutorial

Advanced Topics

API

Known WebServer Issues

References

External Documentations

githalytics.com alpha

Clone this wiki locally