0

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.

1 Answer 1

2

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.

3
  • 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, 2011 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 srv1.mydomain.com? or the cluster architecture is all hidden from him? On the other hand,
    – SJ.Jafari
    Jul 5, 2011 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 such...in 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). Jul 5, 2011 at 16:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .