[Zope] ZPsycopg - Losing Connections

David davidr at talamh.org.uk
Wed Jul 27 06:43:05 EDT 2005


Python 2.3.5 - Zope 2.7.5 - PostgreSQL 7.3.4 - Psycopg 1.1.18 -  
Solaris 8 (Intel)

Hi

I am experiencing a new problem, that was not present in the past on  
the above server. From the Zope error log:

Exception Type      OperationalError
Exception Value    PQsendQuery() -- There is no connection to the  
backend.
Traceback (innermost last):

Module ZPublisher.Publish, line 92, in publish
Module ZPublisher.BaseRequest, line 433, in traverse
Module Products.exUserFolder.exUserFolder, line 869, in validate
Module Products.exUserFolder.exUserFolder, line 1133, in listOneUser
Module Products.exUserFolder.pgAuthSource.pgAuthSource, line 244, in  
listOneUser
Module Shared.DC.ZRDB.DA, line 454, in __call__
<SQL instance at 922dd70>
Module Products.ZPsycopgDA.db, line 228, in query
OperationalError: PQsendQuery() -- There is no connection to the  
backend.

When I check in psql, I can see a connection still being there.
Using the query:
SELECT count(pg_stat_activity.datname) AS count,  
pg_stat_activity.datname FROM pg_stat_activity GROUP BY  
pg_stat_activity.datname;
(Is this really showing active connections? Or just recent usage?)

If I use the close connection and then open connection buttons in the  
Z Psycopg Database Connection in Zope, I get the connection usually  
back. Sometimes I have to re-submit the properties to make it work,  
though.

Properties settings are:
"Connect immediately" is checked
"Use Zope's internal DateTime module (instead of mxDateTime)" is checked
Transaction isolation level:  Serializable
Backend encoding: UTF-8
"Output Unicode strings" is not checked

This is fast becoming a real headache for us!

What has changed? We have recently increased the max_connections and  
shared_buffers for PostgreSQL and now run more Zope instances with  
now averaging about 40 connections from the database (using the query  
above). So this is an increase.

Any help on how I can find out what's going on here is very welcome!  
(or in short: HELP, PLEASE!)

Cheers






More information about the Zope mailing list