Fatal Remaining Connection Slots Are Reserved

On 06/25/2012 11:00 PM, Radovan Jablonovsky wrote:
> Thanks for response,
>
> How were the connections refused (error message)?
> 2012-06-13 13:45:38.809 MDT [25172]: [1-1] FATAL: remaining
> connection slots are reserved for non-replication superuser connections
> 2012-06-13 13:45:38.889 MDT [25173]: [1-1] FATAL: remaining
> connection slots are reserved for non-replication superuser connections
> 2012-06-13 13:45:38.895 MDT [25174]: [1-1] FATAL: remaining
> connection slots are reserved for non-replication superuser connections
>
> Could it be that there are already max_connections
> sessions? max_connection was set to 600, when issue occurred the db
> server had 85 connection and server was under medium load.

Azure Fatal Remaining Connection Slots Are Reserved For Non-replication Superuser Connections

FATAL: remaining connection slots are reserved for non-replication superuser connections. I do not have a DB pooler and my maxconnections is 200. However, max connections for my PHP Application is 120. My server has 128GB and SSD 10K iops disks (Amazon EBS). Can you guys please outlines me the steps to troubleshoot this? Psql: FATAL: remaining connection slots are reserved for non-replication superuser connections こんなこと言って怒られる。 なので、とりあえずTomcatをシャットダウンしてコネクションを空けてからPSQLで接続。.

I can't explain why it was topping out at 85 when it was set to 600, but
- I strongly recommend that you switch to a connection pool and lower
your max_connections considerably. You'll likely get much better
performance with max connections at 20 or less - the usual rule of thumb
is 'num_hdds + num_cpus' but in reality you need to benchmark and tune
to work out what's best.

pgbouncer is a good light-weight pooling option.

--
Craig Ringer

Fatal

On Tue, Feb 7, 2017 at 6:52 PM, Patrick B <patrickbakerbr(at)gmail(dot)com> wrote:

> Hi guys,
>
> I get these messages at least once a day in my Prod environment:
>
>> FATAL: remaining connection slots are reserved for non-replication
>> superuser connections
>
> I do not have a DB pooler and my max_connections is 200. However, max
> connections for my PHP Application is 120.
>
> My server has 128GB and SSD 10K iops disks (Amazon EBS).
>
>
> Can you guys please outlines me the steps to troubleshoot this?
>
> Interesting is that I didn't see any IO/CPU limitation on my server.
>
> I'm currently running a Postgres 9.2 - one master and one slave streaming
> replication.
>
>
> Thanks
>
> Patrick
>

Something is using too many connections.

Fatal Remaining Connection Slots Are Reserved For Non-replication Superuser Connections Aws

I may be wrong but I'm unaware of a limit on connections from PHP except
when you are using persistent connections. Since each PHP script is it's
own process, it can create one or more connections. I'd check to be sure
that every PHP script you have is, indeed, using pg_pconnect and not
pg_connect. That missing 'p' could be hard to spot. I'm assuming, of
course, that you are sure that your PHP script are the only things that can
connect - no scripts, backups, etc. are consuming connections.

But generally I'd advise using pg_bouncer or a similar pooler which can
deal with a mix of connections from persistent and non-persistent
connections from one or multiple hosts.

Cheers,
Steve