Re: PostgreSQL(v9.6.5) not releasing old/inactive IDLE connections - Mailing list pgsql-admin

From Paul Smith
Subject Re: PostgreSQL(v9.6.5) not releasing old/inactive IDLE connections
Date
Msg-id c0ed0cc7-1212-c34c-65ab-139936bdf785@pscs.co.uk
Whole thread Raw
In response to PostgreSQL(v9.6.5) not releasing old/inactive IDLE connections  (Md Arqum Farooqui <Md.Farooqui@india.nec.com>)
Responses Re: PostgreSQL(v9.6.5) not releasing old/inactive IDLE connections  (Thomas Kellerer <shammat@gmx.net>)
List pgsql-admin
On 08/12/2021 06:45, Md Arqum Farooqui wrote:
@font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-fareast-language:EN-US;}a:link, span.MsoHyperlink {mso-style-priority:99; color:#0563C1; text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:#954F72; text-decoration:underline;}span.EmailStyle17 {mso-style-type:personal-compose; font-family:"Calibri",sans-serif; color:windowtext;}.MsoChpDefault {mso-style-type:export-only; font-family:"Calibri",sans-serif; mso-fareast-language:EN-US;}div.WordSection1 {page:WordSection1;}

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 ), 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

pgsql-admin by date:

Previous
From: liam saffioti
Date:
Subject: Re: postgresql long running query
Next
From: "Dischner, Anton"
Date:
Subject: AW: postgresql long running query