Postgres appears to be losing connections from clients. The clients get an error, normally that the connection was closed by the server, while at the same time the server gets a log entry. Example:
Nov 14 17:54:15 dev-db0 postgres[29523]: [219-1] 2014-11-14 17:54:15 GMT [29523]: [2-1] user=******,db=******,remote=10.0.13.1(51491) LOG: could not receive data from client: Connection timed out
As far as I can see, this primarily happens for Windows clients, and is happening across several different database servers, physical and virtual. I first became aware of this issue when a user attempting to access postgres over a VPN was having the problem, but checking the logs shows it happens with local clients too, although the VPN seems to make it happen more often.
I have tried all the keepalive settings in postgresql.conf (tcp_keepalives_idle
, tcp_keepalives_interval
and tcp_keepalives_count
) as well as tunnelling the database connection over SSH, but none seem to make any difference.
While it says timeout on the server side, on the client side it normally says connection reset by peer or similar. The most reliable way to reproduce it is to run large/long queries; pgadmin and tomcat seem to be more susceptible to it than psql.
0 Answers