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 am using apache server as a front end load balancer with tomcat6 servers. I am using lbmethod configuration for making all the requests from one client going to same tomcat always.

<VirtualHost *:1000>
#DocumentRoot /www/docs/
ErrorLog logs/
CustomLog logs/ common

ProxyPass /balancer-manager  !
ProxyPass / balancer://mycluster/ lbmethod=byrequests nofailover=On
ProxyPassReverse / balancer://mycluster/

<Proxy balancer://mycluster>;
BalancerMember ajp://localhost:8101/ route=NodeA1000 retry=10
BalancerMember ajp://localhost:8102/ route=NodeB1000 retry=10
BalancerMember ajp://localhost:8103/ route=NodeC1000 retry=10
BalancerMember ajp://localhost:8104/ route=NodeD1000 retry=10
BalancerMember ajp://localhost:8105/ route=NodeE1000 retry=10

I have 5 tomcats in the back-end. But instead of all requests from the same client going to same tomcat, the requests are load-balanced. Am I missing anything here?

share|improve this question

migrated from Jun 8 '11 at 7:13

This question came from our site for professional and enthusiast programmers.

I agree this belongs on however, this might be helpful.

What you're getting is indeed standard behaviour. However, you're probably struggling with sessions. Read up on session clustering here:

This makes sure sessions are shared amongst your tomcat instances.

Be sure to add distributable="true" to your context.xml files in the application you're deploying like so:

<Context path="/" debug="5" reloadable="true" crossContext="true" distributable="true">
share|improve this answer
Thanks. I think this approach will share the sessions to all the nodes. But i would like to have the same node to receive all the requests for one client – shk Jun 7 '11 at 18:47

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.