Re: Clients disconnect but query still runs - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Clients disconnect but query still runs
Date
Msg-id D960CB61B694CF459DCFB4B0128514C203937E7D@exadv11.host.magwien.gv.at
Whole thread Raw
In response to Re: Clients disconnect but query still runs  (Robert James <srobertjames@gmail.com>)
List pgsql-general
Robert James wrote:
> Is there no way to have the OS interrupt the postgres process
> when a TCP/IP disconnect happens? Or is the OS also in the
> dark that the TCP/IP connection was dropped? I believe that
> there is a way to monitor this using TCP/IP keep alives.
> Or perhaps Postgres could check once every minute? Either
> way, in my experience, solving this would be a major boon to
> high volume servers, at least in the usage patterns I've worked with.

The server machine has no way of knowing that the client died
unless the client closes the connection gracefully.

There are server configuration parameters "tcp_keepalives_idle",
"tcp_keepalives_interval" and "tcp_keepalives_count" which, when
used, will make the operating system check idle connections
regularly.
They are not supported on all operating systems (only on these
whose socket options include TCP_KEEPIDLE, TCP_KEEPINTVL and
TCP_KEEPCNT).

Maybe they can help you.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Building from source vs RPMs
Next
From: Andreas Wenk
Date:
Subject: Re: Video available for PGDay SJC '09