public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bee.Lists <[email protected]>
To: Tom Lane <[email protected]>
Cc: Submit Postgresql Novice <[email protected]>
Subject: Re: Connections Increasing Slowly
Date: Mon, 22 Jun 2020 22:32:56 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>


> On Jun 22, 2020, at 10:07 PM, Tom Lane <[email protected]> wrote:
> 
> Hmm.  If the client thinks the server dropped the connection, but the
> server thinks the connection is still live, that smells strongly of
> network-level disconnects.  Does the client let the connection sit idle
> for more than a minute or two at a time?  If so I'd bet that some firewall
> in between is deciding that the connection is dead and dropping it.
> Again, setting the server's tcp_keepalives_* settings could help fix that,
> by ensuring that the network connection sees some traffic regularly.

The gem says it used something in the connection pool.  Then it says the server dropped it.  Like I said, I’m not clear who owns the connections or the connection pool, as the pool can be outdated.  There’s a check in the gem to check the connection pool for valid connections, over a set amount of time (it’s variable and I can change it, but it does add overhead).  I think that default is 60 minutes.  

The client (this gem) throws an error.  I don’t think any firewall is on this server that I know of.  

Note: This error shows up first thing in the morning sometimes.  I’ve not had it in about a week now.  I have reduced the max_connections to 30, and the connections are now at 4.  I have a bunch of queries on the top page (it’s a dashboard) and it just increased from 2 to 4.

I just set the tcp_keepalives_* to around 3, so we’ll see what’s going on.  Another page request has connections up to 8:

select datid, datname, numbackends, xact_commit, stats_reset from pg_stat_database where datname in (‘mydatabase')

Cheers, Bee









view thread (8+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Connections Increasing Slowly
  In-Reply-To: <[email protected]>

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

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