Re: PostgreSQL 8.4.8 bringing my website down every evening - Mailing list pgsql-general

From Tomas Vondra
Subject Re: PostgreSQL 8.4.8 bringing my website down every evening
Date
Msg-id 4E07B1FF.6050103@fuzzy.cz
Whole thread Raw
In response to Re: PostgreSQL 8.4.8 bringing my website down every evening  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
List pgsql-general
Dne 25.6.2011 13:22, Alban Hertroys napsal(a):
> As another possible improvement, I'd probably not create a new connection in every function call, but use a global
$dbobject instead. Creating DB-connections is relatively expensive, so you don't want to do that more often than
strictlynecessary. In that case you could probably use beginTransaction at the start of your script and commit at the
end.

Not really - he already uses a pgbouncer. Sure, obtaining a connection
from pgbouncer still an overhead, but much smaller than creating a true
pg connection.

But you're right it's a bad programming habbit, and the connection
should be closed at the end.

regards
Tomas

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Postgres errors in Drupal install.
Next
From: Dave Coventry
Date:
Subject: Re: Postgres errors in Drupal install.