Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've decided to cluster my J2EE web application using apache mod_jk as a front-end load balancer which redirects requests to a bunch of tomcat6 instances. Something like this.

But there is a problem that makes me kinda skeptical about this architecture. The single load balancer processes all the requests of this large scaled application at the first place which makes it a bottleneck and a single point of failure as well. Right?

If so, is there a way -like increasing the number of load balancers- to overcome this problem?

btw, if anybody is aware of any J2EE clustered architecture (using Apache and tomcat or anything else) which is implemented in real world , there is plenty of unused space in my brain to fill with those information.

Thanks in advance.

share|improve this question

It is indeed a SPOF.

One relatively crude but cheap solution would be to set up a second and maybe third Apache instance and use round robin DNS.

I suggest that instead you consider an open source load balancer such as HAProxy with Heartbeat to manage a shared IP address. One HAProxy instance would be primary; the other secondary. Using heartbeat, they would manage the ownership of the shared address.

share|improve this answer
Thanks buddy, this seems to solve the SPOF problem. Although SPOF problem is solved by having redundant LBs, but still all the requests and traffic must pass through this single LB machine, right? So wouldn't this be a hardware bottleneck? – SJ.Jafari Jul 5 '11 at 7:12
outta curiosity, after installing HAProxy as the LB, what does user see in the url? does he get redirected to a subdomain like or the cluster architecture is all hidden from him? On the other hand, – SJ.Jafari Jul 5 '11 at 7:13
HAProxy can handle tens of thousands of requests per second. It all depends on the nature of the traffic. Regarding URLs and hostnames and HAProxy's case (and most, if not all, commercial load balancers), it determines what VIP / pool of servers should receive the request based on the IP address. Beyond that, the HTTP Host: header is used by the web server(s). – Scott Smith Jul 5 '11 at 16:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.