[Zope] Zope 2.7.3 Memory Leaks

Dieter Maurer dieter at handshake.de
Thu Jan 6 14:01:24 EST 2005


Andy Yates wrote at 2005-1-5 15:30 -0600:
> ...
>In fact we can reproduce this behavior
>on a fresh install.  On a fresh system create a python script that puts
>data in a session object.
>
>s = context.REQUEST.SESSION
>t = ' ' * 1024
>s['data'] = t
>print "foo"
>return printed
>
>Then call this script with your favorite bench marking program.  We used
>apache bench (ab).  This will cause python2.3 to consume all available
>memory and crash or lockup.

And I am not surprised at all:

  You allow an unlimited number of sessions.

  Your session timeout is 45 minutes

  "ab" does not honour the "set cookie" requests for the sessioning.
  Thus, each request creates a new session.

  This way, it should not be difficult to use
  a large amount of RAM.
  My Zope serves about 500 request/s, 30.000 request/min
  and 1.350.000 requests in 45 min.
  You must expect a number of sessions in this order.

> ...
>In a very basic sense this is all our production server does.  When a
>user first comes to our site we query a mysql database for several
>hundred values.  These values are then stored in the session object as a
>map.  All other pages are built dynamically based on the values stored
>in the session object.  
>
>Is the session object system just not supposed to be used like this?

We use the session system in quite a similar way -- without problems.
But, we have a maximal session count of 5.000.

We, too, observe some increase in memory requirements which we do
not yet understand: memory seems to increase from about 300 MB
to about 600 MB within a week. Therefore, we restart
once every Sunday night. But, the problem has not yet been pressing
and we did not yet seriously tried to understand it.


-- 
Dieter


More information about the Zope mailing list