Re: Setting libpq TCP keepalive parameters from environment

From: Oleksandr Shulgin <oleksandr(dot)shulgin(at)zalando(dot)de>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Setting libpq TCP keepalive parameters from environment
Date: 2018-05-09 09:49:25
Message-ID: CACACo5RvdMHx4XXqQJEMmN2_FmKSz5iLL9nTgBton-Gh4Q3wRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 9, 2018 at 1:58 AM, Craig Ringer <craig(at)2ndquadrant(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Arseny Sher 2018-05-09 11:50:04 Indexes on partitioned tables and foreign partitions
Previous Message Amit Langote 2018-05-09 08:23:23 Re: Should we add GUCs to allow partition pruning to be disabled?