[Zope] Re: nonlinear response times on multiple concurrent requests for same data

Tres Seaver tseaver at zope.com
Sun Sep 12 19:46:00 EDT 2004


Sean Hastings wrote:
> I have a report page that when going through the maximum amount of data
> takes maybe 5 seconds to generate on both my Linux server and on the Windows
> machine I use for development. This report page is a Page Template generated
> from external product code. There is no external database involved - just
> Zope objects.
> 
> I was getting weird periods of serious slowdown on my server, and traced the
> problem to multiple users running this report at the same time.

The Zope application server maintains a pool of ZODB connections for 
each storage being used.  Each pool (the default pool size is 7) has an 
independent object cache associated with it.  When running a request 
which touches lots of objects, a connection which already has most of 
them in cache will return *much* faster than one which must reconstitute 
them from the underlying storage.  When an application thread begins to 
run a request, it acquires connections from that pool, typically getting 
the most-recently-used connection first.

Your symptoms sound almost as though the Windows version is running 
single-threaded, so that the "simultaneous" requests end up being 
serialized;  they thus all use the same connection / cache, and your 
report is thus doing only a linear amount of work.  If the Linux machine

> On the windows machine, if I generate 4 requests, the time to return all of
> them is approximately 20 seconds or x*N response time. On the Linux machine,
> however, I seem to be seeing MUCH longer response times for simultaneous
> requests for the same data. Could this be an issue with the way in which I
> have Zope configured on the server? or does the Linux version do something
> differently?
> 
> I have seen hints of "read only" transactions, but have not been able to
> figure out how to code these. Is there something I could do to make these
> read requests for the same data not interfere with each other?

Try cranking down the number of threads in your Linux server, and see if 
that helps (there is a setting for that in zope.conf, but I don't 
remember the spelling).

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com



More information about the Zope mailing list