Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Chris McDonough
Yes.

All the information in that article is geared for Zope 2.5 which had no
facility for using mounted databases from a config file... everything up
until At this time you should be able to navigate to the
/session_storage folder... in that article can be done by reconfiguring
ZEO using zeo.conf to serve a new storage, changing your ZEO clients'
zope.conf files to recognize the new storage and adding a ZODB Mount
Point from within the ZMI from one of the appservers.  The rest of it
is pretty simple. ;-)

- C


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Fernando Lujan
Chris McDonough wrote:
Yes.
All the information in that article is geared for Zope 2.5 which had no
facility for using mounted databases from a config file... everything up
until At this time you should be able to navigate to the
/session_storage folder... in that article can be done by reconfiguring
ZEO using zeo.conf to serve a new storage, changing your ZEO clients'
zope.conf files to recognize the new storage and adding a ZODB Mount
Point from within the ZMI from one of the appservers.  The rest of it
is pretty simple. ;-)
 

Please, take a look in what I've done! Is that right? It works pretty 
fine here! :-)

If this is right, are there a desire for a how-to? I think I can write 
one, once it's pretty simple as you said.

zope.conf
zodb_db main
 mount-point /temp_folder
 container-class Products.TemporaryFolder.TemporaryContainer
 # ZODB cache, in number of objects
 cache-size 5000
 zeoclient
   server localhost:8100
  storage 1
   name zeostorage
   var $INSTANCE/var
   # ZEO client cache, in bytes
   cache-size 20MB
   # Uncomment to have a persistent disk cache
   #client zeo1
 /zeoclient
/zodb_db
zodb_db temporary
 mount-point /
 # ZODB cache, in number of objects
 cache-size 5000
 zeoclient
   server localhost:8100
  storage 2
   name zeotemporary
   var $INSTANCE/var
   # ZEO client cache, in bytes
   cache-size 20MB
   # Uncomment to have a persistent disk cache
   #client zeo1
 /zeoclient
/zodb_db

zeo.conf
# ZEO configuration file
%define INSTANCE /home/flujan/tmp/zeo
zeo
 address 8100
 read-only false
 invalidation-queue-size 100
 # monitor-address PORT
 # transaction-timeout SECONDS
/zeo
filestorage 1
 path $INSTANCE/var/Data.fs
/filestorage
filestorage 2
 path $INSTANCE/var/SessionData.fs
/filestorage
eventlog
 level info
 logfile
   path $INSTANCE/log/zeo.log
 /logfile
/eventlog
runner
 program $INSTANCE/bin/runzeo
 socket-name $INSTANCE/etc/zeo.zdsock
 daemon true
 forever false
 backoff-limit 10
 exit-codes 0, 2
 directory $INSTANCE
 default-to-interactive true
 # user zope
 python /usr/bin/python2.3
 zdrun /usr/local/zope-2.7.5/lib/python/zdaemon/zdrun.py
 # This logfile should match the one in the zeo.conf file.
 # It is used by zdctl's logtail command, zdrun/zdctl doesn't write it.
 logfile $INSTANCE/log/zeo.log
/runner
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Chris McDonough
On Tue, 2005-04-12 at 18:23, Fernando Lujan wrote:
 Please, take a look in what I've done! Is that right? It works pretty 
 fine here! :-)

If it works for you, it's right. ;-)

 
 If this is right, are there a desire for a how-to? I think I can write 
 one, once it's pretty simple as you said.

Sure, if you'd like... we could point to it from that chapter...

- C


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Richard Jones
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 13 Apr 2005 05:47 am, Fernando Lujan wrote:
 Isn't there a easy way to do this? I was wondering if I couldn just
 createa new filestorage entry in the zeo.conf, and add some lines in my
 zope.conf file.

Is there a viable non-versioned alternative to the filestorage approach? My 
sessions database grows ridiculously quickly. I'm also fairly sure it's 
causing problems when my site gets ~5 requests a second (yes, that low)

Maybe one of these days I'll have time to look into SQLSession, but I'm not 
sure how well it will be able to replace the core session handling (and it 
does need to seamlessly replace it). I wonder how hard it'd be to write a new 
Session Data Manager using an RDBMS as the backend, or even just a filesystem 
approach that didn't use versioning. *shrug*. Mmm. Transactions.


Richard
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCXFUJrGisBEHG6TARAphlAJ4hp/D6u0l/7G1MEhuEsLgykYASfACeNDm0
2CngEMS5lvja4vf2lSuCP5U=
=+7Se
-END PGP SIGNATURE-
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Richard Jones
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 13 Apr 2005 09:44 am, you wrote:
 On Tue, 2005-04-12 at 19:08, Richard Jones wrote:
  Is there a viable non-versioned alternative to the filestorage approach?
  My sessions database grows ridiculously quickly. I'm also fairly sure
  it's causing problems when my site gets ~5 requests a second (yes, that
  low)

 You could use temporarystorage on the ZEO server if you don't really
 need your session data to be persistent across ZEO server restarts.
 This is what Fernando appeared to do in the end.

Having sessions persist across ZEO restarts is a handy thing.

Also, I never figured how to configure a temp storage in a ZEO server. I 
started looking once, but either ran into a dead end or got distracted (or 
both ;)


 There are no well-maintained nonundoing storages that I know of other
 than temporarystorage.  Once upon a time, BerkeleyStorage minimal used
 to work, but its gone the way of the dinosaurs apparently.

And I distrust anything related to Berkely DB :)


 I think any sessioning setup that uses a ZEO-backed storage will be more
 conflict-prone than one that doesn't use ZEO, just because the
 transaction commit time is typically longer.  I'm not sure if this is
 the problem you mention.

Could be.


 Probably not hard.  You could write a session data manager
 implementation that used a relational database.  The interface for those
 things is in Products/Sessions/SessionInterfaces.py

Yeah, I remember poking around that code way back, and it seemed reasonable. 
Its interactions with transactions are the bits that scare me. Using a 
standard RDBMS connection would probably solve that though.


Richard
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCXGFkrGisBEHG6TARAkp7AJ9xavG5iY4wQjGLkdjGmvqxn/mDoACfRXsh
5vLa0EwojCSZlBAi7e1Vuqo=
=WTon
-END PGP SIGNATURE-
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Chris McDonough
On Tue, 2005-04-12 at 19:08, Richard Jones wrote:
 Is there a viable non-versioned alternative to the filestorage approach? My 
 sessions database grows ridiculously quickly. I'm also fairly sure it's 
 causing problems when my site gets ~5 requests a second (yes, that low)

You could use temporarystorage on the ZEO server if you don't really
need your session data to be persistent across ZEO server restarts. 
This is what Fernando appeared to do in the end.

There are no well-maintained nonundoing storages that I know of other
than temporarystorage.  Once upon a time, BerkeleyStorage minimal used
to work, but its gone the way of the dinosaurs apparently.

I think any sessioning setup that uses a ZEO-backed storage will be more
conflict-prone than one that doesn't use ZEO, just because the
transaction commit time is typically longer.  I'm not sure if this is
the problem you mention.

 Maybe one of these days I'll have time to look into SQLSession, but I'm not 
 sure how well it will be able to replace the core session handling (and it 
 does need to seamlessly replace it). I wonder how hard it'd be to write a new 
 Session Data Manager using an RDBMS as the backend, or even just a filesystem 
 approach that didn't use versioning. *shrug*. Mmm. Transactions.

Probably not hard.  You could write a session data manager
implementation that used a relational database.  The interface for those
things is in Products/Sessions/SessionInterfaces.py

- C


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Chris McDonough
On Tue, 2005-04-12 at 20:01, Richard Jones wrote:
 On Wed, 13 Apr 2005 09:44 am, you wrote:
  On Tue, 2005-04-12 at 19:08, Richard Jones wrote:
   Is there a viable non-versioned alternative to the filestorage approach?
   My sessions database grows ridiculously quickly. I'm also fairly sure
   it's causing problems when my site gets ~5 requests a second (yes, that
   low)
 
  You could use temporarystorage on the ZEO server if you don't really
  need your session data to be persistent across ZEO server restarts.
  This is what Fernando appeared to do in the end.
 
 Having sessions persist across ZEO restarts is a handy thing.

Yup.  I've not really needed it so far, but if you need it, you need
it...

 Also, I never figured how to configure a temp storage in a ZEO server. I 
 started looking once, but either ran into a dead end or got distracted (or 
 both ;)

Probably something like what Fernando had on the client:

zodb_db temporary
  mount-point /foo/bar
  # ZODB cache, in number of objects
  cache-size 5000
  zeoclient
server localhost:8999
storage temp
name zeotemporary
var $INSTANCE/var
# ZEO client cache, in bytes
cache-size 20MB
# Uncomment to have a persistent disk cache
#client zeo1
  /zeoclient
/zodb_db

And in the ZEO server's zeo.conf file:

%import tempstorage
temporarystorage temp
   name sessions
/temporarystorage

This resource is useful too:

http://longsleep.org/howto/sharesessionwithzeo

  There are no well-maintained nonundoing storages that I know of other
  than temporarystorage.  Once upon a time, BerkeleyStorage minimal used
  to work, but its gone the way of the dinosaurs apparently.
 
 And I distrust anything related to Berkely DB :)

I hear ya! ;-)

  I think any sessioning setup that uses a ZEO-backed storage will be more
  conflict-prone than one that doesn't use ZEO, just because the
  transaction commit time is typically longer.  I'm not sure if this is
  the problem you mention.
 
 Could be.

It'd be pretty obvious with an inordinate number of conflict errors in
the event log.  inordinate is relative, though, so I'm not sure what
to name as a number per minute for your app.  You can get a sense of
what's normal under contrived load by reading:

http://www.plope.com/Members/dunny/conflicts/view

  Probably not hard.  You could write a session data manager
  implementation that used a relational database.  The interface for those
  things is in Products/Sessions/SessionInterfaces.py
 
 Yeah, I remember poking around that code way back, and it seemed reasonable. 
 Its interactions with transactions are the bits that scare me. Using a 
 standard RDBMS connection would probably solve that though.

Yeah.  Probably OK to use a ZRDB connection, those are controlled
automatically.

- C


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )