Thanks Bernd for giving detailed answer and suggestions.

>  it is the case ... there are two workarounds imho
>  1.
>  don't write to the session if it does not change, so if you do an
>  apache bench without sending the client id cookie, a write is done on
>  each request
>  additionally every anonymous visit writes to zodb, you should avoid
>  this by using default values if no session data is available
>  in earlier versions of zope the __getitem__ method created a btree at
>  first access, but this should be fixed now, so it depends on the
>  version of zope u use, if you have an older version then you can't
>  even look if data is there without writing to zodb

Yes. I looked into the zope.session code. The __getitem__ method will
create new session data if the session package key is not found. On
the other hand, the get method does not create session data. So
changing my code from




avoids the problem of new session data being created at each anonymous request.

>  2.
>  my recommendation is to use memcached for session data ... take a look
>  at

Yes, I think this would be the more decent solution for server side
session data storage for zope3.

Hong Yuan

Zope3-users mailing list

Reply via email to