Sharing session between different zope servers
Hi, We have 10+ Zope (version 2.7) servers ( on different machines). Right now each Zope server independently handles session management which means that if a Zope server fails the users on that Zope server do not get redirected to a functioning Zope server but get "stuck" on the failed Zope server. Is there any way to manage the session of all the zopes servers in a common place. Thanks in advance... Regards, Subish
Hi, You can use collective.beaker to manage your sessions with beaker, and store on the filesystem (if all on the same server) or memcached (if on different servers). That's a code change, though. Martin On 15 June 2011 17:50, Subish K S <kssubish999@yahoo.com> wrote:
Hi,
We have 10+ Zope (version 2.7) servers ( on different machines). Right now each Zope server independently handles session management which means that if a Zope server fails the users on that Zope server do not get redirected to a functioning Zope server but get "stuck" on the failed Zope server. Is there any way to manage the session of all the zopes servers in a common place.
Thanks in advance...
Regards, Subish _______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
On 6/15/11 10:01 AM, Martin Aspeli wrote:
Hi,
You can use collective.beaker to manage your sessions with beaker, and store on the filesystem (if all on the same server) or memcached (if on different servers). That's a code change, though. Products.BeakerSessionDataManager uses collective.beaker as a backend for standard Zope sessions so you don't have to change code. David
---------- David Glick Web Developer davidglick@groundwire.org 206.286.1235x32 GiveBIG is coming! Give to Groundwire on June 23 and The Seattle Foundation will stretch your money! http://www.groundwire.org/blog/give-big-is-coming
On Wed, Jun 15, 2011 at 6:50 PM, Subish K S <kssubish999@yahoo.com> wrote:
We have 10+ Zope (version 2.7) servers ( on different machines). Right now each Zope server independently handles session management which means that if a Zope server fails the users on that Zope server do not get redirected to a functioning Zope server but get "stuck" on the failed Zope server. Is there any way to manage the session of all the zopes servers in a common place.
If you have only a moderate number of sessions, you can store the session storage on the ZEO server. If you use buildout you'd do something like: [zeo] recipe = plone.recipe.zeoserver ... zeo-conf-additional = %import tempstorage <temporarystorage temp> name temp storage for sessioning </temporarystorage> [instance1] recipe = plone.recipe.zope2instance ... zodb-temporary-storage = <zodb_db temporary> mount-point /temp_folder <zeoclient> server 10.0.0.1:8100 storage temp name zeo-temp-storage </zeoclient> </zodb_db> The config is the same if you just put these straight into zope.conf and zeo.conf. Zope 2's built-in session machinery should handle a couple dozen sessions at a time. Once you go beyond that look at Beaker (via collective.beaker) and memcached as a backend. This does apply to the currently supported Zope 2 versions (2.12 & 2.13). I have no idea what of this works in the ancient 2.7. Hanno
On Wed, Jun 15, 2011 at 10:49 PM, Hanno Schlichting <hanno@hannosch.eu> wrote: [...snip...]
Zope 2's built-in session machinery should handle a couple dozen sessions at a time. Once you go beyond that look at Beaker (via collective.beaker) and memcached as a backend.
Is memcached a reliable storage for session data ? I am also searching for a good session storage mechanism. I also found another backend for Beaker: http://pypi.python.org/pypi/mongodb_beaker I would like to hear others experience with memcached as a reliable storage for session data. Regards, Baiju M
On Wed, Jun 15, 2011 at 7:26 PM, Baiju M <baiju.m.mail@gmail.com> wrote:
Is memcached a reliable storage for session data ?
I would like to hear others experience with memcached as a reliable storage for session data.
It depends on what kind of reliability you need. Generally your sessions should be short-lived and memcached is fine for that. If you want to store really long-lasting session data, you can use any SQL database backend for Beaker via SQLAlchemy. Hanno
On Wed, Jun 15, 2011 at 11:07 PM, Hanno Schlichting <hanno@hannosch.eu> wrote:
On Wed, Jun 15, 2011 at 7:26 PM, Baiju M <baiju.m.mail@gmail.com> wrote:
Is memcached a reliable storage for session data ?
I would like to hear others experience with memcached as a reliable storage for session data.
It depends on what kind of reliability you need. Generally your sessions should be short-lived and memcached is fine for that.
Well, what about a persistent session storage for 20 minutes in memcached ? Do we have any control over when the keys are evicted ? I am just reading few articles related to this: http://sparklewise.com/?p=538 http://en.wikipedia.org/wiki/Slab_allocation http://code.google.com/p/memcached/wiki/MemcachedSlabAllocator Regards, Baiju M
On 15 June 2011 19:05, Baiju M <baiju.m.mail@gmail.com> wrote:
On Wed, Jun 15, 2011 at 11:07 PM, Hanno Schlichting <hanno@hannosch.eu> wrote:
On Wed, Jun 15, 2011 at 7:26 PM, Baiju M <baiju.m.mail@gmail.com> wrote:
Is memcached a reliable storage for session data ?
I would like to hear others experience with memcached as a reliable storage for session data.
It depends on what kind of reliability you need. Generally your sessions should be short-lived and memcached is fine for that.
Well, what about a persistent session storage for 20 minutes in memcached ? Do we have any control over when the keys are evicted ?
I am just reading few articles related to this: http://sparklewise.com/?p=538 http://en.wikipedia.org/wiki/Slab_allocation http://code.google.com/p/memcached/wiki/MemcachedSlabAllocator
If you don't supply the -M argument then memcached won't evict objects before their expiration time, but it may run out of memory. The new unlogged tables in Postgres 9.1 might be a great fit, though you'll still wipe sessions when you make changes to your infrastructure / restart stuff. But most sites can cope with that. Laurence
On 06/15/2011 07:19 PM, Hanno Schlichting wrote:
On Wed, Jun 15, 2011 at 6:50 PM, Subish K S <kssubish999@yahoo.com> wrote:
We have 10+ Zope (version 2.7) servers ( on different machines). Right now each Zope server independently handles session management which means that if a Zope server fails the users on that Zope server do not get redirected to a functioning Zope server but get "stuck" on the failed Zope server. Is there any way to manage the session of all the zopes servers in a common place.
If you have only a moderate number of sessions, you can store the session storage on the ZEO server. If you use buildout you'd do something like: (snip configuration for that)
The config is the same if you just put these straight into zope.conf and zeo.conf. Zope 2's built-in session machinery should handle a couple dozen sessions at a time. Once you go beyond that look at Beaker (via collective.beaker) and memcached as a backend.
This does apply to the currently supported Zope 2 versions (2.12 & 2.13). I have no idea what of this works in the ancient 2.7.
It should work, but the problem lies in the "moderate" amount of users, and the performance issues one may expect (notably read conflicts before 2.8, BTree conflicts before 2.10 or 2.11). The original poster may also go as far as setting up a separate ZEO server just for sessions, if that's worth the effort. -- Georges Racinet, http://www.racinet.fr, http://anybox.fr Zope/CPS & OpenERP expertise, assistance & development GPG: 0x4862FFF7 identi.ca & twitter: gracinet
participants (7)
-
Baiju M -
David Glick -
Georges Racinet -
Hanno Schlichting -
Laurence Rowe -
Martin Aspeli -
Subish K S