You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Pontus <po...@ullgren.com> on 2011/06/17 10:42:08 UTC

Tomcat 6.0 Clustering and non-sticky session loadbalancer

Hello,

The Tomcat 6.0 Clustering/Session Replication HOW-TO states "Make sure
that your loadbalancer is configured for sticky session mode".

However if I configure my Tomcat cluster to have session replication, why
would sticky sessions be required ?

I can see cases where sticky sessions are for performance a better option,
I might have some DB cache not connected to the session or some
non-serialized data. However provided that I store all session data in the
session object and have all data serializable is sticky session mode in
the LB really a requirement and if so why ?

Best regards
Pontus Ullgren


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


Re: Tomcat 6.0 Clustering and non-sticky session loadbalancer

Posted by Reinwald Warapen <re...@directi.com>.
You may want to go through this if you want an alternative to 
store/share sessions: 
http://www.reinwaldwarapen.com/2011/01/storing-and-sharing-sessions-among.html

On 6/17/2011 2:12 PM, Pontus wrote:
> Hello,
>
> The Tomcat 6.0 Clustering/Session Replication HOW-TO states "Make sure
> that your loadbalancer is configured for sticky session mode".
>
> However if I configure my Tomcat cluster to have session replication, why
> would sticky sessions be required ?
>
> I can see cases where sticky sessions are for performance a better option,
> I might have some DB cache not connected to the session or some
> non-serialized data. However provided that I store all session data in the
> session object and have all data serializable is sticky session mode in
> the LB really a requirement and if so why ?
>
> Best regards
> Pontus Ullgren
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


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


Re: Tomcat 6.0 Clustering and non-sticky session loadbalancer

Posted by Mark Thomas <ma...@apache.org>.
On 17/06/2011 09:42, Pontus wrote:
> Hello,
> 
> The Tomcat 6.0 Clustering/Session Replication HOW-TO states "Make sure
> that your loadbalancer is configured for sticky session mode".
> 
> However if I configure my Tomcat cluster to have session replication, why
> would sticky sessions be required ?

If you use the Backup manager, you must use sticky sessions since the
session is only backed up to a single node (selected at random for each
session) in the cluster.

If you use the delta manager, sticky sessions are advisable for several
reasons:
- Parallel requests. If a browser issues multiple requests in parallel
and these are handled by different nodes one request might not see that
session changes triggered by a different request and that might be an issue.
- Performance. Without sticky sessions, you need to use use synchronous
session replication to ensure all the other nodes in the cluster have
the updates before the next request is issued. That takes time.
- Debugging. Trying to figure out what went wrong is usually hard enough
without each request going to a different node.

Mark

> I can see cases where sticky sessions are for performance a better option,
> I might have some DB cache not connected to the session or some
> non-serialized data. However provided that I store all session data in the
> session object and have all data serializable is sticky session mode in
> the LB really a requirement and if so why ?
> 
> Best regards
> Pontus Ullgren
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 




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