Re: Clearing out old idle connections

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Clearing out old idle connections
Дата
Msg-id 44745111.4080001@archonet.com
обсуждение исходный текст
Ответ на Clearing out old idle connections  (Gavin Hamill <gdh@laterooms.com>)
Ответы Re: Clearing out old idle connections  ("Florian G. Pflug" <fgp@phlo.org>)
Список pgsql-general
Gavin Hamill wrote:
> Hullo :)
>
>
> We have pg 8.1.3 and for whatever reason (network blips, poor pooling on
> behalf of the client, etc.) we sometimes see a large number (dozens) of
> old connections in the idle state which never get reused.

They should expire based on your TCP/IP settings. It's a TCP/IP
connection timeout issue really, PG never gets to see them.

> Is there a function in postgres similar to MySQL's 'wait_timeout' which
> automatically closes any connections which have been idle for N seconds?
> Is this functionality possible to to script/cron by examining the pg
> catalogs and finding a 'last used' timestamp?

Hmm - are the times in pg_stat_activity useful to you.

> I am aware the correct response is 'deal with the cause, not the
> symptoms', however I assure you that this academic approach wins no
> friends in the enterprise market that postgres pitches itself at :)

Run pgpool in front of PG for real control. That should be simple enough
to tweak to provide whatever timeout rules you want.

HTH
--
   Richard Huxton
   Archonet Ltd

В списке pgsql-general по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: challenging constraint situation - how do I make it
Следующее
От: Sim Zacks
Дата:
Сообщение: Re: background triggers?