tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Rees <dr...@greenhydrant.com>
Subject Re: mod_jk load balancing question
Date Tue, 20 Jan 2004 07:29:17 GMT
Rahul Kuchhal wrote, On 1/19/2004 3:25 PM:
> Hi! I have a question about the load balancing
> capabilities of JK connector. If this is not the
> correct forum to ask this please let me know.
> 
> We have been using a single apache load balanced
> equally between two Tomcat machines, using JK
> connector. Now during load tests on one of the
> installation the load is getting distributed evenly
> but on another installation (different machines and
> different application) the load distribution is very
> uneven. It always favors one Tomcat machine over the
> other in the ratio of 5:1.
> 
> We have checked everything including the load factor
> etc. But the Tomcat sessions on one machine is 50 and
> on another one they are only 10.
> 
> Is there a place where I can get more information
> about the load balancing algorithm? Any thing we can
> do to figure out why it is behaving in such a way?

This is a known issue with the JK connector.  The problem (as it was 
described to me) is that each Apache process does not communicate with 
the others regarding what tomcat workers it has sent requests to (the 
load balancing information).  This leads to the Apache processes 
choosing the same worker frequenty to do the work.

One work around is to use Apache2's worker MPM which is multi threaded. 
  Threads will share the load-balancing information, so requests will be 
spread out a lot more evenly.  Unfortunately, the threaded MPM isn't 
stable for all workloads so you'll have to test it to see if it works 
for you.

Another work around is to tweak the lbfactor values in your 
workers.properties files until the load is distributed fairly evenly. 
This is process would have to be done through trial and error.

I've looked at the load balancing code in mod_jk, it seems horribly 
complex for what probably should be a rather simple algorithm.  It was 
also designed to have the load-balancing information shared between 
processes, but that portion of the code was never written.  I'm sure the 
developers would welcome patches!  ;-)

-Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message