Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have 3 tomcat servers where users get into all time. They are 3 because the processing of each request is heavy (lot of sql). Users enters to server 1 or 2 or 3. Now I want to make them "one". I know I need do clustering but, will clustering spread the requests thru the 3 servers or here is where I need implement load balancing with apache2 ?

share|improve this question

You can use mod _ jk

Remember to set sticky _ session on the mod _ jk and tomcat connector

share|improve this answer

You are going to be creating a virtual "one" machine that the outside of your "cluster" or load balanced architecture will only see as one actual machine. For example, you have one Real IP address (the outside routable IP) and 3 virtual IP's (the internal ip that the load balancer assigns) It also depends on how your application is put together. Does it have sessions? Is it stateful or not?

Load balancers such as or kemp technologies can forward people with specific sessions to a specific server (A, B, or C) until the session ends and then may move them to another server for load balancing.

The end result (users browser) doesn't care what server it is actually on, it only ever see's the one Real IP address and is sending session information in the hopes that it's request will be answered properly. Just that if it sends sessions information the server that the load balancer sends them to knows what it is and will route it, and distribute incoming user load accordingly.

share|improve this answer

Take a look at Teracotta for web sessions.

Use Terracotta's fast, reliable web sessions plugin to get the scalability benefits of a stateless web architecture without overloading your database or rewriting your application. Terracotta for Sessions works with your favorite web framework and your own custom session objects.

The web sessions tutorial lists five simple steps for you to make in order to evaluate the product ( FOSS ).

share|improve this answer

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.