You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@mohawksoft.com on 2009/12/17 21:31:53 UTC

Re: Storing Tomcat Sessions to MySQL (and Memcached) Round-Robin without sticky sessions

> Hi Mark, Thanks for the reply.
>
> In your opinion should we be using local memory to store any session
data? The discussion right now is to store everything to cache+db and
nothing in local memory.

(Sorry, hit enter before complete)

The "right" answer, for an arbitrary definition of "right," is a little
more complicated.

A UDP based server to reduce the TCP/IP overhead.
The protocol should be something like this: (pseudo code)

class Session
{
    int version;
    UUID session;
    ....
};

Object lockSession(uuid session)
Object lockSession(Object session)
void unlockSession(Object session)
void abandonSession(uuid session)
Object peekSession(uuid session)
Object peekSession(Object session)


The two variants uuid session and Object session allow the local layer to
pass a version identifier to the server if they already have the object.
That way, if the object exists and is at the correct version, it need not
be retrieved. The UUID version always retrieves the session.

The peek vs lock allow modules to peek at session information without
modifying it.

The unlock allows an atomic operation that updates and unlocks the
"global" copy.

The abandon API allows a module that had previously locked the session
object to unlock it without changing the version or contents.



> On Sat, Dec 12, 2009 at 5:06 AM, Mark Woodward <ma...@mohawksoft.com>
wrote:
>> About 12 years ago, I wrote a system called msession for PHP that was
basically a high-speed cache for sessions. I have been using it for PHP
sites ever since. The one thing I've never liked about tomcat is sticky
sessions. It doesn't scale well enough. With gig ethernet, a shared
network
>> based caching system is probably the best way to go.
>>
>> Also, it would be good if the format of the session data could be used by
>> other platforms, i.e. PHP and Tomcat could share sessions.
>>
>> Is anyone actively working on the session management of tomcat?
>>
>>
>> anthonyvierra@gmail.com wrote:
>>>
>>> Hello, Thanks in advance for your help.
>>>
>>> I would like to know if anyone is currently modifying, has modified,
or plans to modify Tomcat 6.0.20 to store/read sessions directly in
Memcached + MySQL to enable session persistence with round-robin and
without sticky sessions?
>>>
>>> If so would you be so kind as to point me in the right direction?
>>>
>>> Our top level design requirement is 'no sticky sessions' + 'round
robin' + 'MySQL or Amazon SimpleDB'
>>>
>>> After getting this solution working I would like to donate the code to
the Tomcat project. It will be useful for those wishing to deploy
Tomcat + Amazon EC2 + Amazon Elastic Load Balancer.
>>>
>>> Thank you,
>>> Anthony
>>> 925-456-4343
>>>
>>> ---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>>
>
> --------------------------------------------------------------------- To
unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>




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