tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pascal Forget <pascal.for...@videotron.ca>
Subject Re: Apache 1.3.23 + Tomcat 4.0.2 Load balancing HOWTO
Date Fri, 25 Jan 2002 15:51:02 GMT
Salut Christophe,

Furmaniak Christophe wrote:

> Good job!

Thanks, I appreciate it.

> Except that you might specify that creating two
> instances of the tomcat installation is not needed
> as you can share the main binaries and libs by
> specifying 2 distinct CATALINA_BASE variables.

True, but in real life the two tomcat servers are usually
located on two different machines.  My setup might be
overkill for a single machine setup, but it's easy to
tar up the "tomcat2" server and put it on a second
machine; you just have to change "localhost" to the
appropriate machine name in
/usr/local/apache/conf/workers.properties and you're
done.

> Just maybe one more question, why does Craig R. McClanahan
> did first answer that load balancing was not working
> in TC4 and then Remy Maucherat answered it worked by
> specifying the jvmRoute param for the engine?

Because this is a brand new feature that appeared only
in tomcat 4.0.2 Beta2 and there is little or no mention
of it on the Jakarta web site.

The documentation on the Jakarta site is lacking, and
that is why I took six hours of my time to write up my
setup instructions.  That's my way of giving back to the
Apache community.

> What does not work and what does work in load balancing?


Load balancing works great.

1. Session affinity works

Which means that when a client browser is directed to
a Tomcat server by the load balancer, then future queries
from that same browser session will always be directed to
the same tomcat server.  This is important because sessions
that are created in a specific tomcat server, say "tomcat1",
do not exist in the other server "tomcat2", and thus if
the client was directed to another tomcat server than the
one where his session is stored, then all his session data
would be lost.

Some people are working on sessions that will be replicated
across all tomcat servers in the cluster, so I'll just wait
for it to become available rather than make a homebrewed
distributed session mechanism.

The downside of not having sessions replicated across all
the tomcat servers in the cluster is that if one tomcat
server dies, all the sessions that it contained are lost,
which usually makes a lot of unhappy users.

2. Failover works

If one tomcat server dies, the load balancer then
"rebalances" the queries to the remaining tomcat
servers.

3. Failback works

When a tomcat server comes back from the dead, the load
balancer automatically starts to send queries to it. So
you can actually add capacity to your cluster on the fly.

4. Weighted load balancing works

In /usr/local/apache/conf/workers.properties, I assigned
a load balancing factor of 100 to both "tomcat1" and
"tomcat2" servers.  Then I changed the lbfactor of
"tomcat1" to 101, and I saw that effectively the "tomcat1"
server received more load than the "tomcat2" server, which
is something you want when for example your "tomcat1" server
is a faster/newer machine while your "tomcat2" server is a
slower machine which cannnot take as much load as the other
one.


Pascal









--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message