Re: Max connections reached without max connections reached - Mailing list pgsql-general

From Tom Lane
Subject Re: Max connections reached without max connections reached
Date
Msg-id 4176160.1637681607@sss.pgh.pa.us
Whole thread Raw
In response to Max connections reached without max connections reached  (James Sewell <james.sewell@jirotech.com>)
Responses Re: Max connections reached without max connections reached
List pgsql-general
James Sewell <james.sewell@jirotech.com> writes:
> The system handles a lot of connections - we have a max_connections of 600.
> Most are long lived JDBC, but there are a lot of ETL / ad-hoc jobs etc.

> Connections normally sit at 300ish, with 70 active at the most. The
> machines have 32 CPU cores . PgBouncer is sadly not an option hereas we are
> using many long lived connections which make use of prepared statements.

> Sometimes a strange condition occurs. The number of connections is well
> under 600 (and dropping), but new connections are not being allowed into
> the database, I can see this message in the logs:

>    (0:53300)FATAL:  remaining connection slots are reserved for
> non-replication superuser connections

What are you looking at to claim the number of connections is under 600?
Maybe there's some disconnect between what you're measuring and what the
database thinks.

A different line of thought is that ProcArray slots can be consumed by
things that aren't client connection processes, in particular
(1) parallel-query workers
(2) autovacuum workers
Looking into pg_stat_activity when you see this issue might help
clarify that.

            regards, tom lane



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Regex for Word space Word space Word ....
Next
From: "David G. Johnston"
Date:
Subject: Re: PQexecParams, placeholders and variable lists of params