From: Paul Smith <paul@pscs.co.uk>
To: pgsql-admin@lists.postgresql.org
Subject: Re: PostgreSQL(v9.6.5) not releasing old/inactive IDLE connections
Date: Wed, 8 Dec 2021 09:18:22 +0000
Message-ID: <c0ed0cc7-1212-c34c-65ab-139936bdf785@pscs.co.uk> (raw)
In-Reply-To: <OS3PR01MB581659FF3F8020F174751B4BA76F9@OS3PR01MB5816.jpnprd01.prod.outlook.com>
References: <OS3PR01MB581659FF3F8020F174751B4BA76F9@OS3PR01MB5816.jpnprd01.prod.outlook.com>
On 08/12/2021 06:45, Md Arqum Farooqui wrote:
>
> Hi,
>
> I'm facing "Too many clients already" error frequently with my
> PostgreSQL (v9.6.5) container (i.e. being used along with CKAN
> application i.e. A open source data management system
> <https://ckan.org/> ), I have observed that PostgreSQL is not
> releasing IDLE connections from their end. I have set "max_connetions
> = 100" in postgresql.
>
It is the responsibility of the client software to release connections
when they are no longer needed. The server won't just time-out idle
connections unless it is told to do so
I guess CKAN is keeping a pool of available connections that it can
reuse without having to start a new connection. You may be able to set
parameters in CKAN so that it kills connections after they have been
idle a while. If you're not sure, you really need to ask on a CKAN
support forum
Or you could use a separate connection pooler (eg PgBouncer) and have
CKAN connect to that instead of the database directly. The pooler will
then manage reuse across all the client applications, and may be able to
timeout idle connections for you.
--
Paul
Paul Smith Computer Services
support@pscs.co.uk - 01484 855800
--
Paul Smith Computer Services
Tel: 01484 855800
Vat No: GB 685 6987 53
Sign up for news & updates at http://www.pscs.co.uk/go/subscribe
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: paul@pscs.co.uk, pgsql-admin@lists.postgresql.org
Subject: Re: PostgreSQL(v9.6.5) not releasing old/inactive IDLE connections
In-Reply-To: <c0ed0cc7-1212-c34c-65ab-139936bdf785@pscs.co.uk>
* 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