Re: PostgreSQL 8.4.8 bringing my website down every evening

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL 8.4.8 bringing my website down every evening
Date: 2011-06-26 22:26:07
Message-ID: 4E07B1FF.6050103@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 $db object instead. Creating DB-connections is relatively expensive, so you don't want to do that more often than strictly necessary. 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Coventry 2011-06-26 23:10:43 Re: Postgres errors in Drupal install.
Previous Message John R Pierce 2011-06-26 21:37:22 Re: Postgres errors in Drupal install.