Re: Setting libpq TCP keepalive parameters from environment - Mailing list pgsql-hackers

From Oleksandr Shulgin
Subject Re: Setting libpq TCP keepalive parameters from environment
Date
Msg-id CACACo5RvdMHx4XXqQJEMmN2_FmKSz5iLL9nTgBton-Gh4Q3wRQ@mail.gmail.com
Whole thread Raw
In response to Re: Setting libpq TCP keepalive parameters from environment  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
On Wed, May 9, 2018 at 1:58 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
>
> It would be much more convenient to just set the environment variable when
> running the script and let it affect the whole process and its children.
>
> Would a patch be welcome?

I can't really comment on that part, but:

PGOPTIONS="-c tcp_keepalives_count=5 -c tcp_keepalives_interval=60"
psql 'host=localhost'

should enable server-side keepalives. Unsure how much that helps you
if you need client-side keepalives too.

Good point, in our specific case it appears to work as well if it's the server who sends the keepalives.

Thank you,
--
Alex

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Should we add GUCs to allow partition pruning to be disabled?
Next
From: Arseny Sher
Date:
Subject: Indexes on partitioned tables and foreign partitions