Re: postgres client connection issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ranjeet Singh03 <Ranjeet_Singh03(at)infosys(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: postgres client connection issue
Date: 2017-02-04 15:32:01
Message-ID: 9111.1486222321@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Ranjeet Singh03 <Ranjeet_Singh03(at)infosys(dot)com> writes:
> Thanks Tom for acknowledge my mail. Below is the detail as you requested:
> PG Version DBD::Pg : 2.10.3

That's not the Postgres version ... but anyway, given that the server
is seeing this:

> 2017-02-01 10:56:27 LOG: could not receive data from client: Connection reset by peer
> 2017-02-01 10:56:27 LOG: unexpected EOF on client connection

while the client is seeing this:

>> DBD::Pg::st execute failed: server closed the connection unexpectedly

it sure looks like this is basically a network problem: something in
between is killing the connection.

If the sessions that are dying had been sitting idle for awhile, the
most likely theory is that there's something with an activity timeout,
probably a router. If you can't identify the something and change its
settings, it might help to enable TCP keepalives. Setting
tcp_keepalives_idle to something less than the shortest observed
failure interval ought to do it. (The effective default is probably
something like an hour, and at a guess, you might need to set it to
something near 5 or 10 minutes.)

If you're seeing active sessions die like this, that moves it out of
the sphere of "something's misconfigured" and into the sphere of
"something's broken". Could be as simple as a flaky cable. Looking
into the kernel logs for the communicating machines might help; if
there's a router in between, try to enable event logging on it.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2017-02-04 15:56:56 Re: postgres client connection issue
Previous Message luc.gilot 2017-02-04 09:06:14 BUG #14528: ODBC bug "cursor is open"