From: | Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> |
---|---|
To: | Aras Angelo <araskoktas(at)gmail(dot)com> |
Cc: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: idle connections |
Date: | 2009-10-05 23:48:04 |
Message-ID: | dcc563d10910051648r34fe72e2uaf3f8fa364d7462f@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On Mon, Oct 5, 2009 at 4:42 PM, Aras Angelo <araskoktas(at)gmail(dot)com> wrote:
> Hi,
>
> Im seeing lots of idle connections (not idle in transaction) to my database
> server. My front end is written with PHP and i couldnt find anything that
> can cause this. If i do a kill proc-id every few minutes on my server via
> cron, would this effect anything badly?
Are you using pg_pconnect?
pg_pconnect is a foot gun waiting to happen. It's an otherwise very
useful foot gun, but a foot gun none-the-less.
The problem is that by default apache is usually set up to have more
max connections / children / threads etc. than postgresql is to have
backends available. This just gets worse if you run < 1 apache server
machine.
The simple solution is to turn off pg_pconnect.
If things are then too slow then you can start planning for
connection pooling / pg_pconnect otherwise don't sweat it. For low
level intranet servers, regular pg_connect will work just fine.
From | Date | Subject | |
---|---|---|---|
Next Message | Aras Angelo | 2009-10-05 23:50:55 | Re: idle connections |
Previous Message | Lee, Mija | 2009-10-05 23:47:42 | constraints set to deferrable by default |