pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Ribe <scott_ribe@elevated-dev.com>
To: Rajesh Kumar <rajeshkumar.dba09@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Handling idle connections
Date: Tue, 26 Sep 2023 09:08:01 -0600
Message-ID: <B13D56C5-061D-462C-86CD-CA8FE3F22B21@elevated-dev.com> (raw)
In-Reply-To: <CAMkU=1wYSYE-0ZRcTyib=moGWj4iA3xP0V67m5q7J438yuVzTw@mail.gmail.com>
References: <CAJk5Ata=NXO46e7RcS-CxEXvroz=-fojS+XzpW-Bty+G-sx51A@mail.gmail.com>
	<AB0BD6D8-DFE1-4918-9AF6-0A9A1ED5CEBE@crazybean.net>
	<CAJk5AtaSH0n_Uc3R2JpfirW0MhHt1SxZNkB-ZuJmTR6VcfALGw@mail.gmail.com>
	<CAMkU=1xiG4S+gxLMfE-F6vSjchoBwfnZd4W8KdOSO7DMt2zDSg@mail.gmail.com>
	<CAJk5AtbjuM9UYVgFm=aQvjgO9SWaBRejTYWNG9N=5ALV=2d+EA@mail.gmail.com>
	<CAMkU=1wYSYE-0ZRcTyib=moGWj4iA3xP0V67m5q7J438yuVzTw@mail.gmail.com>

> I am assuming like tell them "check sessions are closed properly" like dat?

Don't open until needed, close when done. Assuming they're actually a problem--for smaller scale environments, it can be perfectly OK to have clients holding connections open for the entire client lifetime.

Set application name on connection, so that *if* there is a problem it's easier to track down.

> On Sep 26, 2023, at 8:55 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
> 
> You haven't answered my question.  If "query" is truly blank and it is not just a permission problem, then the issue is not that they fail to close connections after use, but rather that they open connections and then never use them.

Which could easily be a matter of some pg library being used. As far as I see, there was also never an answer to whether this is actually a problem and if so, how?

And one more: if there is a problem, why not use pgbouncer?

We've given all the information we can about how to identify such connections. Any further help would depend on more info from Rajesh.




view thread (15+ messages)  latest in thread

Message-ID: <B13D56C5-061D-462C-86CD-CA8FE3F22B21@elevated-dev.com>
Permalink:  ../B13D56C5-061D-462C-86CD-CA8FE3F22B21@elevated-dev.com/
Also on:    postgresql.org/message-id/B13D56C5-061D-462C-86CD-CA8FE3F22B21@elevated-dev.com

 · 

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-admin@postgresql.org
  Cc: scott_ribe@elevated-dev.com, rajeshkumar.dba09@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Handling idle connections
  In-Reply-To: <B13D56C5-061D-462C-86CD-CA8FE3F22B21@elevated-dev.com>

* 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