[Zope-dev] Database connections

Martijn Pieters mj@digicool.com
Sun, 13 Feb 2000 07:03:53 -0500


From: Stephan Richter [mailto:srichter@cbu.edu]
> My client went live with a site today and we are having huge problems
> with the DB connections. Every one out of five times the request will
> time out. We are heavily using DB tables for our data storage. (We are
> using PostGres.)
> 
> My client has read that other people experienced the same issue, since
> only 7 DB connections are allowed at a given time. She read 
> that you can
> hack the python code somewhere. I am sure you guys know how 
> to do this.
> If you could send me a set of instructions of how to fix it, 
> that would
> be great.

As the ZPostgreSQLDA is not thread safe, it uses only one DB connection
for all threads. It is a so-called level 2 DA. For an explanation, see:

  http://www.zope.org/Members/petrilli/DARoadmap

I thus doubt that your problem is related to the 7 ZODB connection
limit. I you don't specify how many threads Zope should use (with
z2.py), you will never run into this limit.

I suggest you first try and pinpoint the problem. The following HowTos
might help:

  http://www.zope.org/Members/mcdonc/HowTos/DEBUG-LOG
  http://www.zope.org/Members/klm/debuggingzope
  http://www.zope.org/Documentation/Misc/DEBUGGING.txt

Also, have a look at /Control_Panel/manage_debug.

I have a feeling it might be related to the ZPostgreSQLDA, but that is
only a hunch, nothing concrete.

-- 
Martijn Pieters, Software Engineer 
| Digital Creations http://www.digicool.com 
| Creators of Zope      http://www.zope.org 
| mailto:mj@digicool.com       ICQ: 4532236
| PGP:
http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 
-------------------------------------------