From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Simon Riggs <simon(at)2ndquadrant(dot)com>, Robert Haas <rhaas(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: [COMMITTERS] pgsql: Add TCP keepalive support to libpq. |
Date: | 2010-06-24 14:30:59 |
Message-ID: | AANLkTin_f3nK1S_ZgjZ2-BlD5dWi8ngKjFK8_GUDXGQ-@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers pgsql-hackers |
On Thu, Jun 24, 2010 at 10:13 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
>> On Wed, 2010-06-23 at 21:54 +0000, Robert Haas wrote:
>>> This adds four additional connection parameters to libpq: keepalives,
>>> keepalives_idle, keepalives_count, and keepalives_interval.
>>> keepalives default to on, per discussion, but can be turned off by
>>> specifying keepalives=0. The remaining parameters, where supported,
>>> can be used to adjust how often keepalives are sent and how many
>>> can be lost before the connection is broken.
>
>> There isn't any need at at all for this. We can already add options on
>> the libpq connection line.
>
>> options = '-o tcp_keepalives_idle=X
>> tcp_keepalives_interval=Y
>> tcp_keepalives_count=Z'
>
> Huh? The above is 100% fanciful; there was no code in libpq or anywhere
> else that would have processed such a thing.
You can do this:
psql "host=127.0.0.1 options='-c tcp_keepalives_idle=1'"
...but it doesn't do the same thing as this patch. It lets you set
the TCP keepalive parameters on the server side, whereas what this
patch does is let you set them on the client side. Only setting them
on the client side will allow the client to notice when the server has
gone away.
There is still an open question in my mind as to whether this is
really an adequate solution to the walrecevier problem, but as you
say, if it turns out not to be, it's got other value.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company
From | Date | Subject | |
---|---|---|---|
Next Message | Florian Pflug | 2010-06-24 14:40:41 | Re: [COMMITTERS] pgsql: Add TCP keepalive support to libpq. |
Previous Message | Tom Lane | 2010-06-24 14:13:51 | Re: [COMMITTERS] pgsql: Add TCP keepalive support to libpq. |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2010-06-24 14:32:00 | Re: EOL is when? |
Previous Message | Tom Lane | 2010-06-24 14:20:10 | Re: TOAST issue on custom index access method |