Re: keepalive problem with libpg connection

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Juan Backson <juanbackson(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: keepalive problem with libpg connection
Date: 2009-08-11 15:10:06
Message-ID: b42b73150908110810t61dd5b58q218bb2fca02018fb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Aug 11, 2009 at 3:56 AM, Juan Backson<juanbackson(at)gmail(dot)com> wrote:
> Hi,
>
> I am writing my own connection pool for libpq's connection.
>
> My goal is to try to reduce the amount of time spent in opening and closing
> socket.   However, I see that Postgres would close my connection after every
> so often.

it's not postgres, most likely someone in the middle is closing
inactive connections, typically after 3-5 minutes. check out the
keepalive settings in postgresql.conf to handle this on the tcp level
(better than throwing a select 1).

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Headland 2009-08-11 16:55:36 Re: Updating a specific number of rows in pl/pgsql
Previous Message Pavel Stehule 2009-08-11 10:55:05 Re: Updating a specific number of rows in pl/pgsql