Comments inline..

Gianny Damour wrote:
On 17/02/2007, at 3:32 AM, Dave Colasurdo wrote:
<snip>

Tomcat and Mod-jk provide the ability to have the load balancer lock a particular httpsession (identified by session cookie) to a specific cluster member. This cluster member will serve all the requests for this session until the cluster member tops/fails and failover to a new cluster member occurs. This "stickiness" is quite useful for the case of multi-frame JSPs where it is important that all concurrent requests are executing in the same JVM (as per Java EE specifications). Hmmm, now that Terracotta provides the concept of a global cross-node JVM, I'm wondering how important this is now .. though still seems there would be performance overhead in locking across JVMs.. so I think Sticky Session is still useful..

Hi,

I think that if you have sticky load balancing, you do not need to acquire a distributed lock to service concurrent requests: requests are proxied to the node hosting the session state; each request acquires a *local* read lock for the associated session (a read lock is acquire such that requests bound to the same session can proceed concurrently).

This is only when a request is received by a node where the session state cannot be found that a distributed lock is to be acquired.

Thanks,
Gianny



Hi Gianny,

Thanks for the input. I agree no distributed lock is required with sticky session since all request are guaranteed to be running in the same JVM.

I believe that Terracotta transparently shuttles the session data between the cluster members without the application server ever knowing that the session was actually created in a different JVM.

For the case where sticky session isn't configured it is possible for a multiframe JSP to spray requests to multiple servers concurrently. The servlet specification states:

"Within an application marked as distributable, all requests that are part of a session must be handled by one Java Virtual Machine1 (“JVM”) at a time."

So, for this case there would need to be some sort of distributed lock. I believe Open Terracotta provides a mechanism to lock across JVMs though believe sticky port would be a much better performing solution.

-Dave-





Reply via email to