keepalive problem with libpg connection

From: Juan Backson <juanbackson(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: keepalive problem with libpg connection
Date: 2009-08-11 07:56:59
Message-ID: 27c25bc40908110056v76a03483uf42355c5648c15b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

What is the best solution for that? Should I regularly send some "Select 1"
to keep the connection alive or is there a better way to write a connection
pool for libpq?

Any suggestion will be greatly appreciated.

JB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2009-08-11 10:25:03 Re: Updating a specific number of rows in pl/pgsql
Previous Message Juan Backson 2009-08-11 07:52:50 Re: Need help with libpq and PQexec[RESOLVEd]