tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Papillon" <>
Subject jk load balancing based upon ip address rather than session id
Date Thu, 12 Jun 2008 17:11:55 GMT

I'm using jk 1.2.25 with tomcat 5.5.25 and apache 2.0 on one debian
box - 2.4.27-2-386 i686 GNU/Linux

I've set up 3 tomcat instances  that receive requests from  the jk
load balancer worker

I've implemented in the web application, a simple cross domain single
sign on (SSO)  mechanism.   This mechanism ties the different session ids in
any single container together, regardless if they've originated from
different domains, for example:

Hence when a user "logs on" this is then reflected in all the
different sessions that they might be in a particular container for
that user, from the serviced domains that they've visited.

This is fine when there is just one container.  But when there are
several all servicing requests in a load balanced context, it doesn't
work, because the session ids from different domains may be directed
to different tomcat instances / containers, which then breaks the
assumption that the SSO mechanism relies upon (that all sessions being
held in a single container).

The tomcat instances aren't in a distributed cluster and I'd like to
keep it that way.

My initial idea is to balance the traffic based upon the ip address
rather than the session id, thus I can be assured that all requests
from a particular ip address will hit the same container, and hence
the single sign on mechanism will work.  I realise that this would
give me a much less granular balancing profile.  I'd much prefer to do
this through the jk load balancer although as an alternative I could
do it through the balancer web app that comes with tomcat and
implement a Rule in java myself.

I'm open to other ideas that get the job done.

I've read the following:

I've searched the forums as well,

I had a cheeky look at the source too for shits and giggles, but still no joy.
seems like the "get_most_suitable_worker" function is very much driven
from the session id - I'm no a C programmer :-(

My question is has anyone already done this?  Is there a better way of
doing it that I'm missing, or should I basically just do it through
the balancer web in tomcat app and forego the jk load balancer, or
bite the bullet and make the tomcat containers a cluster.

Any suggestions / help would be very much appreciated

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message