[Zope] performance issues

Matthew T. Kromer matt@zope.com
Mon, 28 Oct 2002 10:04:46 -0500


John Doe wrote:

>Hi,
>
>I'm running a Zope-application (2.5.1, Python 2.1.3)
>on a dual processor (1 GB mem) Redhat 7.3 machine.
>User-authentication is done by the
>exUserFolder-product (on Postgresql 7.2.1). An
>apache-server runs in front of the Zope server.
>
>Now for the problem/questions. 
>Problem: unacceptable performance with 200
>requests/sec. 
>Questions: 
>- which steps can be taken to improve performance ? 
>for the moment 6 child processes are running which
>each use 60 MB of memory (?isn't this alot) ;
>increasing the number of threads will probably help,
>but if each thread will probably use 60 MB
>- how good is the smp-support of Zope (Python) ?
> 
>  
>

Keep in mind that Python uses a global interpreter lock (GIL) to 
serialize access to the Python interpreter between threads.  In 
multiprocessor environments, this can degrade performance when the 
operating system schedules work for CPUs which do not hold the GIL.

I would expect Zope's rendering performance on a uniprocessor AMD Athlon 
2000+ to be on the order of 15-30 pages per second for a reasonably 
complex site.  "Complexity" is closely correlated to the amount of 
objects needed to be accessed by the interprester -- the more things 
your pages include, the slower they will render.  The key to high volume 
sites is to render a page once, then cache it.  You can use Zope's 
caching, or an external cache such as squid.  Zope Corporation uses 
squid to accelerate sites they host.

Zope's performance scales linearly with the pystone benchmark.

The "fixed cost" of asking Zope to serve something is much higher than 
the fixed cost of asking apache or squid to serve something -- Zope can 
still serve hundreds of images per second on a fast machine, but squid 
and apache can serve thousands.

Zope is a reasonably complex piece of software, and it's not easy to do 
much more than give "default" pointers for tuning.  One thing you can do 
is raise your ZODB cache size in the control panel.  You should probably 
run multiple Zope instances, using a ZEO storage.  You should use apache 
or squid in front of Zope to prevent Zope from rendering the same page 
multiple times.

-- 
Matt Kromer
Zope Corporation  http://www.zope.com/