Skip to main content
SQLSTATE 53300

PostgreSQL too_many_connections

PostgreSQL rejected a new session because the server has reached its usable connection limit.

PostgreSQL server connection admissionCapacityhigh
Exact message
FATAL: remaining connection slots are reserved for non-replication superuser connections

Also searched as: too_many_connections · sorry, too many clients already

What it means

The server cannot allocate another ordinary backend. The configured maximum includes reserved capacity, so application clients can be rejected before the raw max_connections value appears fully consumed.

Typical trigger conditions

  • An application connection leak
  • A traffic spike without pooling
  • Too many pool instances or oversized per-instance pools
  • Long-lived idle sessions consuming the connection budget
Evidence before intervention

First diagnostic checks

1

Count sessions by state

Identify whether active work or idle clients are consuming the budget.

SELECT state, count(*) FROM pg_stat_activity GROUP BY state ORDER BY count(*) DESC;
2

Find the largest client groups

Group sessions by application and source before terminating anything.

SELECT application_name, client_addr, count(*) FROM pg_stat_activity GROUP BY 1,2 ORDER BY 3 DESC;
3

Compare configured capacity

Check max_connections and the reserved slots on the affected server.

SHOW max_connections; SHOW superuser_reserved_connections;

Version and platform notes

Reserved-connection settings vary by PostgreSQL version. Check the documentation for the deployed major version before changing capacity.

Continue the investigation

Engineering signal

Follow PostgreSQL failures and fixes

One useful weekly email with new error references, tools, integration notes and production lessons. No daily noise.