Re: PostgreSQL 8.4.8 bringing my website down every evening

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: PostgreSQL 8.4.8 bringing my website down every evening
Дата
Msg-id 4E07B1FF.6050103@fuzzy.cz
обсуждение исходный текст
Ответ на Re: PostgreSQL 8.4.8 bringing my website down every evening  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Список 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 по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: Postgres errors in Drupal install.
Следующее
От: Dave Coventry
Дата:
Сообщение: Re: Postgres errors in Drupal install.