pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: fran.tm213@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17776: Connections are terminated unexpectedly sometimes
Date: Mon, 06 Feb 2023 10:39:59 -0500
Message-ID: <2665710.1675697999@sss.pgh.pa.us> (raw)
In-Reply-To: <17776-36d858c9afa20043@postgresql.org>
References: <17776-36d858c9afa20043@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> I am running Ruby on Rails app with postgresql 14.6 on ubuntu 20.
> For some reason, the connections are terminated unexpectedly while running a
> background job.
> Regarding background job, it requires around 100~200 connections over
> 6~7hrs.
> I've checked postgresql log around that time.
> 2023-02-06 06:45:41.702 UTC [341438] user@db_production LOG:  could not
> receive data from client: Connection reset by peer
> 2023-02-06 08:26:56.134 UTC [352190] user@db_production LOG:  could not
> receive data from client: Connection reset by peer
> 2023-02-06 08:26:56.134 UTC [352191] user@db_production LOG:  could not
> receive data from client: Connection reset by peer

Looks like something in your network infrastructure is timing out
and dropping idle connections too quickly.  If you can't fix the
actual problem, Postgres' TCP-timeout settings might provide a
workaround by maintaining an illusion that the connection is
busy.  See

 tcp_keepalives_count
 tcp_keepalives_idle
 tcp_keepalives_interval
 tcp_user_timeout

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <2665710.1675697999@sss.pgh.pa.us>
Permalink:  ../2665710.1675697999@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2665710.1675697999@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, fran.tm213@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17776: Connections are terminated unexpectedly sometimes
  In-Reply-To: <2665710.1675697999@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox