Verified limit lookup

PostgreSQL max_connections Explained

How PostgreSQL max_connections actually works, how to inspect it, reserved slots, provider caps, and safer scaling choices.

Verified Aug 22, 20261 official source
Quick answer

PostgreSQL has no single universal connection maximum: Configured per server; typically 100 by default. The effective user capacity is also reduced by reserved connection slots and may be capped by a managed provider.

Verified Aug 22, 2026Official source

Current limits

ConstraintCurrent valueScopeVerified source
max_connectionsThis is not a universal hard maximum. Kernel settings, provider configuration, reserved slots, and memory affect usable capacity.Configured per server; typically 100 by defaultPostgreSQL 18PostgreSQL Global Development GroupAug 22, 2026

Why does this limit matter?

PostgreSQL sizes shared resources from max_connections, so increasing it consumes more memory and can reduce performance.

Application pool sizes multiply across processes, replicas, and deployments; their sum matters more than one instance's setting.

What should you check?

  1. Run SHOW max_connections on the target server.
  2. Count active and idle sessions in pg_stat_activity.
  3. Inventory pool maximums across every application instance before changing the server.

How to inspect the current value

Run this on the exact server or managed instance you are diagnosing.

SHOW max_connections;

SELECT state, count(*)
FROM pg_stat_activity
GROUP BY state
ORDER BY count(*) DESC;
Changing max_connections requires a server restart and increases resource allocation. Prefer right-sized pooling before raising it.

Important caveats

  • Managed providers can impose their own caps or recommended settings.
  • superuser_reserved_connections and reserved_connections affect how many ordinary sessions can actually connect.
HyperObserve reports the documented platform constraint. Your application, SDK, gateway, provider, region, or account can impose a lower effective limit.
Related

Related references and tools

Found an outdated limit? Report it.