Re: Surviving connections after internet problem

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'Durumdara *EXTERN*'" <durumdara(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Surviving connections after internet problem
Date: 2016-11-07 15:06:17
Message-ID: A737B7A37273E048B164557ADEF4A58B53979346@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Durumdara wrote:
> Linux server, 9.4 PG, Windows clients far-far away.
>
> They called us that they had an "internet reset" at 13.00, but many client locks are alive now
> (14:00).
> I checked server status, and and saw 16 connections.
>
> In Windows PG server I read about keepalive parameters which are control and redefine default TCP
> keepalive values.
>
> As I read it could be two hours in Windows, and it is a system default, so we can change for all
> applications.
>
> I don't know what happens with Linux server and Windows clients.
>
> May Linux version of PGSQL also uses 2 hour keepalive (default), or the it caused by Windows clients,
> or an active device?
>
> Or how could they survive this internet connection reset? :-o
>
> May we must limit these parameters in clients after the starting of the connection?

Don't bother about the clients, just see that the backends go away on the server.

You can use pg_terminate_backend to kill a database session.

Setting the keepalive options in postgresql.conf can make PostgreSQL
discover dead connections more quickly.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arthur Silva 2016-11-07 16:13:43 Re: Changing foreign key referential actions in big databases
Previous Message Tom Lane 2016-11-07 14:33:59 Re: Changing foreign key referential actions in big databases