Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread David G. Johnston
On Mon, Jun 16, 2025, 10:21 Adrian Klaver wrote: > On 6/16/25 09:29, adolfo flores wrote: > > Hello Team, > > > > I hope you can help me with an issue we're experiencing. We have an app > > running on Kubernetes that opens a huge number of connections within a > > couple of seconds. > > > > The d

Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread Adrian Klaver
On 6/16/25 11:09 AM, David G. Johnston wrote: I am not understanding the above. The connection limit from the database side is going to be the value for max_connections. It is not clear to me what "...  connection limit of 30% of the max_connections setting" is refer

Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread Marco Torres
You might want to explore pgpool and pgbouncer. Depending in your use case you might want to glue them togeter. On Mon, Jun 16, 2025, 10:39 AM Tom Lane wrote: > adolfo flores writes: > > I hope you can help me with an issue we're experiencing. We have an app > > running on Kubernetes that opens

Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread Adrian Klaver
s referring to? I suggest providing the actual numbers you are working with as well as the locations where the numbers are being set. set for that database, we're seeing the following errors in the PostgreSQL logs: FATAL:  sorry, too many clients already FATAL:  remaining connection sl

Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread Richard Welty
a coding error i've seen from inexperienced devs with little database experience is inattentiveness to how the DB connections were being opened. last time i saw this, a smart young dev with no DB background did not understand the cost of opening connections and had on the order of 30 php calls t

Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread Tom Lane
adolfo flores writes: > I hope you can help me with an issue we're experiencing. We have an app > running on Kubernetes that opens a huge number of connections within a > couple of seconds. You need to fix that app to be less unfriendly, or maybe put it behind a connection pooler. > Is it expect

Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread adolfo flores
tting. Despite this limit being set for that database, we're seeing the following errors in the PostgreSQL logs: FATAL: sorry, too many clients already FATAL: remaining connection slots are reserved for roles with the SUPERUSER attribute Is it expected behavior to reach the max_connections limit

RE: Re: too many clients already

2020-04-02 Thread Abraham, Danny
Subject: [EXTERNAL] Re: too many clients already "Abraham, Danny" writes: > Well, I guess the questions is - how do I optimize PG for a stream of very > short life checks... You should be using a connection pooler for a load like that. PG backends are fairly heavyweight things --- y

Re: too many clients already

2020-04-02 Thread Tom Lane
"Abraham, Danny" writes: > Well, I guess the questions is - how do I optimize PG for a stream of very > short life checks... You should be using a connection pooler for a load like that. PG backends are fairly heavyweight things --- you don't want to fire one up for just a single query, at least

RE: Re: too many clients already

2020-04-02 Thread Abraham, Danny
:37.014 CDTLOG: connection received: host=10.64.72.157 port=45813 2020-04-02 11:05:37.018 CDTFATAL: sorry, too many clients already 2020-04-02 11:05:37.015 CDTLOG: connection received: host=10.64.72.157 port=45815 2020-04-02 11:05:37.015 CDTLOG: connection received: host=10.64.72.157 port=45817

Re: too many clients already

2020-04-02 Thread Tom Lane
"Abraham, Danny" writes: > Running on a big and stressed AIX platform and receiving lots of "CDTFATAL: > sorry, too many clients already" > and transient difficulty to log in. > Happens on all PG versions (Tested 9.5,10.4,11.5) > Big installation: max_connecti

RE: Re: too many clients already

2020-04-02 Thread Abraham, Danny
va-tlv-ctm-qa22.isr.bmc.com% sql psql: FATAL: sorry, too many clients already va-tlv-ctm-qa22.isr.bmc.com% sql psql (11.5) Type "help" for help. ctrlmdb=> show max_connections; max_connections - 1200 (1 row) ctrlmdb=> show shared_buffers;

Re: too many clients already

2020-04-02 Thread Adrian Klaver
: Abraham, Danny ; pgsql-gene...@postgresql.org Subject: [EXTERNAL] Re: too many clients already On 4/2/20 8:22 AM, Abraham, Danny wrote: No pg-bouncer or connection pooling. ps -elf | grep postgres | grep idle | wc -l ==>61 and BTW: Running, say 500 one command psql in parallel will have

RE: Re: too many clients already

2020-04-02 Thread Abraham, Danny
Big installation: max_connections is 1200, shared_buffers is 2GB -Original Message- From: Adrian Klaver Sent: Thursday, April 02, 2020 6:30 PM To: Abraham, Danny ; pgsql-gene...@postgresql.org Subject: [EXTERNAL] Re: too many clients already On 4/2/20 8:22 AM, Abraham, Danny wrote

Re: too many clients already

2020-04-02 Thread Adrian Klaver
how max_connections; -Original Message- From: Rob Sargent Sent: Thursday, April 02, 2020 6:10 PM To: Abraham, Danny Cc: pgsql-gene...@postgresql.org Subject: [EXTERNAL] Re: too many clients already On Apr 2, 2020, at 9:06 AM, Abraham, Danny wrote: Hi, Will appreciate a hint here. Runn

RE: Re: too many clients already

2020-04-02 Thread Abraham, Danny
ene...@postgresql.org Subject: [EXTERNAL] Re: too many clients already > On Apr 2, 2020, at 9:06 AM, Abraham, Danny wrote: > > Hi, > > Will appreciate a hint here. > > Running on a big and stressed AIX platform and receiving lots of "CDTFATAL: > sorry, too many

Re: too many clients already

2020-04-02 Thread Adrian Klaver
On 4/2/20 8:06 AM, Abraham, Danny wrote: Hi, Will appreciate a hint here. Running on a big and stressed AIX platform and receiving lots of "CDTFATAL: sorry, too many clients already" and transient difficulty to log in. Happens on all PG versions (Tested 9.5,10.4,11.5) Big in

Re: too many clients already

2020-04-02 Thread Rob Sargent
> On Apr 2, 2020, at 9:06 AM, Abraham, Danny wrote: > > Hi, > > Will appreciate a hint here. > > Running on a big and stressed AIX platform and receiving lots of "CDTFATAL: > sorry, too many clients already" > and transient difficulty to log in. &g

too many clients already

2020-04-02 Thread Abraham, Danny
Hi, Will appreciate a hint here. Running on a big and stressed AIX platform and receiving lots of "CDTFATAL: sorry, too many clients already" and transient difficulty to log in. Happens on all PG versions (Tested 9.5,10.4,11.5) Big installation: max_connections is 1200, shared_