Re: Safe to kill idle connections? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Safe to kill idle connections?
Date
Msg-id 43536231.9030505@archonet.com
Whole thread Raw
In response to Safe to kill idle connections?  (Francisco Reyes <lists@natserv.com>)
Responses Re: Safe to kill idle connections?  (Francisco Reyes <lists@natserv.com>)
List pgsql-general
Francisco Reyes wrote:
> Ever since I installed a particular program, PHPWiki, I am seeing idle
> postgres sessions.. even days old. Is it safe to delete them?
>
> For example:
> postmaster: wiki simplicato_wiki [local] idle (postgres)
>
> Ultimately I will either switch wiki or take the time and find the piece
> of code that is causing the sessions to remain open, but until then
> don't want to leave those idle sessions around.. for days.

At a guess, PHPWiki is using persistent connections to PG, so you'll get
one connection per Apache backend. If you reduce the number of idle
Apache backends you should reduce the number of idle PG connections too.
Alternatively, a small change in PHPWiki's code should clear it too
(start with a search for pg_pconnect and try pg_connect instead).

It's perfectly safe to leave the idle connections there - they won't
take up much in the way of resources.

HTH
--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: "Stefano B."
Date:
Subject: could not connect to the server error
Next
From: "Paul Newman"
Date:
Subject: What to use for GUIDS ?