Clustering Benchmark Application
Pull request Compare This branch is even with clusterbench:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Build Status

ClusterBench is a simple application that can be deployed in a cluster of JBoss AS 5 (EAP 5), JBoss AS 7 (EAP 6), WildFly 8 and newer. Once deployed it is easy to stress (using JMeter, curl, etc) and monitor the performance of the cluster while at the same time it can be easily checked the correctness of replicated sessions.


Clone the Git repository first and switch to the created directory:

$ git clone

It comes in 3 flavors for Java EE 5, 6 and 7:

$ mvn install -Pee7 # default; requires JDK 7 or newer
$ mvn install -Pee5,ee6,ee7 # builds everything; requires JDK 7 or newer
$ mvn install -Pee6
$ mvn install -Pee5

Output files:



JBoss AS 7 / WildFly 8 and newer

You can use the deploy target of the WildFly Maven Plugin to deploy to your running instance by running:

$ mvn wildfly:deploy

which will deploy the resulting EAR to the running server.

To do this manually, copy clusterbench-ee7.ear (or clusterbench-ee6.ear for AS 7) to server's deployments directory and start the standalone server in the HA mode:

$ cd ~/wildfly-8.0.0.Final
$ cp ~/clusterbench-ee6.ear standalone/deployments/
$ ./bin/ -c standalone-ha.xml

You can also use the CLI to do so by starting the server, connecting with CLI and using deploy command:

$ cd ~/wildfly-8.0.0.Final
$ ./bin/ -c standalone-ha.xml

Then connect with the CLI:

$ ./bin/ -c
[standalone@localhost:9990 /] deploy ~/clusterbench-ee7.ear

If you prefer GUI, you can start the server and navigate to http://localhost:9990/ and follow the instructions.


To deploy the Tomcat variant of clusterbench, copy the following war file into Tomcat installation webapps/ directory:

$ cp ~/clusterbench-ee7-web/target/clusterbench-ee7-web-tomcat.war webapps/

Note that CDI, debug, EJB, granular, JSF servlets are unsupported on Tomcat and not bundled in the war.

JBoss AS 5

Copy clusterbench-ee5.ear to your server's deploy directory, e.g.:

$ cp clusterbench-ee5.ear ~/jboss-5.0.0/server/all/deploy/

Live Demo

You can try a demo running for free on OpenShift by Red Hat:

Please do not benchmark this instance!

Scenario Servlets

Each servlet stresses a different replication logic, but they all produce the same reply: number of times (integer) the servlet has been previously invoked within the existing session in a text/plain response. In other words, the first request returns 0 and each following invocation returns number incremented by 1.

Furthermore, each HTTP session carries 4 KB of dummy session data in a byte array.



The 'default' servlet. Stores serial number and data in SerialBean object (POJO) which is directly stored in javax.servlet.http.HttpSession.



Stores a serial number in @SessionScoped bean.



Stores serial and data in @Stateful EJB Session bean (SFSB). The EJB is then invoked on every request.



Stores serial number and data separately and are both directly put to javax.servlet.http.HttpSession. The byte array is never changed therefore this can be used to test effectiveness of using granular session replication.

Load Servlets

There are also two oad generating Servlets for memory and CPU usage. These Servlets simulate load on the target system. These can be used to test the load-balancing mechanism of the reverse proxy.



Servlet simulating memory usage of the Java Virtual Machine (JVM). Parameters are milliseconds (duration) and megabytes.



Servlet simulating CPU load of the cluster node. Parameters are milliseconds (duration) and threads.


Create them on GitHub Issues:


Contributions are welcome! Submit pull requests against the upstream repository on GitHub. Please follow the coding standards to keep the application simple and clean.


Project is licensed under Apache License Version 2.0.

Happy benchmarking!