tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Ricker <>
Subject Re: distributed environment
Date Wed, 26 Jun 2002 14:02:08 GMT
On Tue, 2002-06-25 at 20:15, David Mossakowski wrote:

> My questions about this:
> 1. I'm assuming that with a single Apache server that it has mutltiple 
> Tomcat servers that it balances across therefore knowing which session 
> to send where but how is a "sticky" session achieved with mutliple 
> Apache instances? The last sentence suggests this is possible.

I cannot speak for Tomcat, but if I am not mistaken, it works as Jserv
does for load-balancing.

Anyway, the session id is written to the cookie that is presented to
Apache, which passes it to the Jserv/Tomcat connector. When
load-balancing, the Jserv/Tomcat connector knows which Tomcat instance
(i.e., IP and port) to send the request until that session is ended.
> 2. Is using a single Apache server serving across multiple Tomcats and 
> having another Apache server connected to the same Tomcats as a standby 
> if the first goes down an effective solution for high availability?

Not the most effective. If you have some sort of load-balancer (i.e.,
proxy server, dedicated load-balancer, DNS, etc), you can use BOTH
Apache's which receive requests and forward them to the correct
instance. If an Apache goes down, the other one will take over and the
user will see know problems (unless the load across two Apaches would
kill one Apache).

> I'm not too concerned with migrating sessions or session failover as 
> long as a session is continued (meaning the request goes to the same 
> Tomcat instance).  Currently I'm looking into persistent storage on a 
> database but I worry it's too costly (timewise).

There is a caveat: if a Tomcat instance fails, all sessions on that
instance will fail at the next request since the cookie will still point
to it. At the next request, they will get a "session time-out" or
whatever you do when they first initiate the session (i.e., a login

> -- Bottom Line --
> Please let me know what can I expect from Apache/Tomcat combination in a 
> distributed environment without going the EJB, big-ass-expensive 
> application server route.

Most app servers do session failover, so they will be better. I also
have seen a way to do session failover using a JVM-to-JVM socket
connection which passes session information between JVMs. Have not tried
it myself.

Ben Ricker
Web Security System Administrator

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message