O'Reilly logo

WildFly Configuration, Deployment, and Administration - Second Edition by Christopher Ritchie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Load-balancing between nodes

We will run a couple of tests in order to investigate how mod_cluster distributes the load between several different clients.

For these tests, we will use a very basic web application. The application source can be found with the source code for this book; the project is called chapter9-balancer. It contains a simple index.jsp page, which dumps a message on the console:

<%
Integer counter = (Integer)session.getAttribute("counter");
if (counter == null) {
  session.setAttribute("counter",new Integer(1));
}
else {
  session.setAttribute("counter",new Integer(counter+1));
}
System.out.println("Counter"+session.getAttribute("counter"));          
%>

After deploying the application, go to the URL http://192.168.0.10/balancer/index.jsp

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required