11

Am a sql DBA, learning postgres..In postgres logs i often receive "could not receive data from client: Connection timed out" I do not have any other logs other than this

Am not sure how to troubleshoot? I check the application logs and DBs logs to compare the time but I could not notice any abnormalities.

can someone guide me how to trace this issue.

Thanks

asked Dec 30, 2016 at 4:52

2 Answers 2

8

A few possibilities:

  • Your application closes connections without telling the PostgreSQL server it's doing so, by simply closing the network socket. It should send a PQclose(conn) if using libpq, or whatever equivalent your language/driver has.

  • Network address translation timeouts on idle connections or other related network issues cause the TCP connections to break, so client and server lose communication with each other.

  • A firewall on the client or server is blocking or disrupting connections after they're established (maybe malfunctioning IDS?)

answered Dec 30, 2016 at 4:57
1
  • IDS meaning Intrusion Detection? Commented Dec 31, 2016 at 10:51
1

iptables firewall may need a rule to be able to send out to the Postgres port you are connecting to:

iptables -L -n
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5432
answered Jun 3, 2018 at 3:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.