Brian Stansberry's Blog

November 6, 2008

First Beta Release of the mod_cluster Project

Filed under: JBoss — Brian Stansberry @ 6:08 am
Tags:

On behalf of the teams working on the JBoss Web and JBoss AS Clustering projects, I’m very pleased to announce the 1.0.0.Beta1 release of the mod_cluster project.

For full details on the project, please see the mod_cluster project page on jboss.org. Downloads are available at the project download page.

Like mod_jk and mod_proxy, mod_cluster is an httpd-based load balancer that can proxy requests to a cluster of Tomcat-based webservers (either standalone Tomcat, standalone JBoss Web or JBoss AS’s embedded JBoss Web). Where mod_cluster differs from mod_jk and mod_proxy is that it provides a back channel from the webservers back to the httpd servers. The webservers use this back channel to provide information to the httpd-side about their current state. The use of this back channel provides a number of advantages:

  • Dynamic configuration of httpd workers. No more tedious listing of static cluster topologies in workers.properties and uriworkermap.properties. No more having to remember to update workers.properties before adding a new node to a cluster. With mod_cluster, configuration is done on the application server side.  Start a new app server and it registers with the httpd-side, informing it of its configuration. Deploy a war and the app server notifies the httpd-side that URLs for the war’s hostname and context path can be routed to that server. Repetitious configuration is nearly eliminated, since the app server already knows most values, e.g. the address and port of the AJP connector.
  • Server-side load balance factor calculation.  A load balancer like mod_jk and mod_proxy_balancer can only base its load balancing decisions on information available on the load balancer side, e.g. how many requests it has passed to each node and how many sessions were associated with those requests. If the cluster is using more than one load balancer, each has no idea about the load being proxied by the others. And none have any knowledge of critical server-side information like CPU or heap utilization. With mod_cluster, the app servers periodically examine their running condition and tell the httpd-side the proportional load each should bear. And a configurable, pluggable set of load metrics gives great flexibility to admins in deciding what runtime metrics should drive the load balancing decision.
  • Fine grained web-app lifecycle control.  Traditional httpd-based load balancers do not handle web application undeployments particularly well. From the proxy’s perspective a backend server can handle a given URL if the URL is in the static global configuration and the server’s AJP connector is functioning. So, if you undeploy a war from a running server, the load balancer will continue to route requests for that war’s URLs to that server, leading to 404 errors. In mod_cluster, each server forwards any web application context lifecycle events (e.g. web-app deploy/undeploy) to the proxy informing it to start/stop routing requests for a given context to that server. Requests are stopped before the application undeploys. No more 404s.

An added benefit of mod_cluster is that, unlike mod_jk, use of the AJP protocol between httpd and the back-end servers will be optional. The httpd connections to application server nodes can use HTTP, HTTPS, or AJP. (Note that in this first beta release, testing has been focused on AJP.)

I encourage you to give mod_cluster a try and to give us your feedback. As with all open source projects, community feedback is essential. The best place for feedback is the mod_cluster user forum.

Many thanks to Jean-Frederic Clere, Paul Ferraro and Rémy Maucherat for their hard work on this release; the vast majority of the credit goes to them.

Enjoy!

8 Comments »

  1. This is awesome. I had lot of 404 errors during failover testing of JBoss Portal because mod_jk and server were not in synch all the time. This for sure solves that problem.

    Comment by prabhat jha — November 6, 2008 @ 4:30 pm | Reply

  2. […] November 10, 2008 Posted by Sacha in JBoss. trackback JBoss’s clustering and httpd teams recently announced the first beta of mod_cluster and I am not sure it got the visibility it deserves, so I wanted to give it more exposure as it aims […]

    Pingback by Tech News: mod_cluster and embedded AS « Sacha’s Weblog — November 10, 2008 @ 1:53 pm | Reply

  3. This is really great news. Well done to Brian and the rest of the team 🙂

    Are you planning on adding preferred failover buddy to mod_cluster?

    Comment by Galder Zamarreno — November 17, 2008 @ 7:28 pm | Reply

  4. […] HTTPD module for clustering java web apps. TAGS: […]

    Pingback by First Beta Release of the mod_cluster Project | alef0.com — November 25, 2008 @ 7:55 pm | Reply

  5. Galder,

    A preferred failover node configuration can be done with mod_cluster (or mod_jk for that matter) by combining the mod_XX “domain” configuration with the “buddyPool” configuration in the web session cache. I’ll have to write a separate post with those configuration details.

    The essence of it is, say you have a four node cluster {A, B, C, D}. You want to configure 2 groups, named for example AB and CD, such that A and B replicate to each other to provide a backup of the session, and mod_cluster prefers to fail over to B if A fails and vice versa.

    The downside of doing this kind of thing is the granularity of the failover target is too coarse. If A,B,C,D are each handling 25% of requests, and then A leaves, B will start handling 50% of requests, C and D still 25%. Over time the load will balance out again, as new sessions are created, but that could take quite a while. If you let the load balancer pick the failover target from any node, B,C,D each will quickly end up serving 33% of requests. But, the downside there is more data is more data is moving around the cluster as C and D have to pull the session backup data from B before handling a request.

    Comment by bstansberry — November 25, 2008 @ 8:12 pm | Reply

  6. Nice entry (and a good start in the blogging space 🙂

    Comment by Dimitris Andreadis — October 13, 2009 @ 6:41 am | Reply

  7. […] team as well as excellent community feedback, mod_cluster has progressed rapidly since I first blogged about it. It’s always been possible to integrate mod_cluster into JBoss AS, but now Paul has done most […]

    Pingback by Clustering Features in JBoss Application Server 6.0.0.M1 « Brian Stansberry's Blog — December 2, 2009 @ 11:01 am | Reply

  8. […] mod_cluster: apache HTTPD module for clustering java web apps. […]

    Pingback by First Beta Release of the mod_cluster Project | — December 16, 2012 @ 11:02 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a reply to First Beta Release of the mod_cluster Project | Cancel reply

Create a free website or blog at WordPress.com.