Notice Configuration

Few Superuser Reserved Connections

Very few connections are reserved for superusers, which may prevent administrators from connecting during a connection exhaustion crisis.

What is this issue?

PostgreSQL reserves connections for superusers via superuser_reserved_connections.
These connections remain available even when regular connections are exhausted.

If set too low (< 3):
- Administrators may not be able to connect during crises
- Diagnosing connection exhaustion becomes impossible
- Manual intervention requires console access

The default is 3, which is usually sufficient.

Why it matters

Admin Lockout

Can't connect to diagnose when connections are full

Delayed Recovery

Must use console access instead of SQL

Monitoring Gaps

Monitoring tools may lose access

Crisis Management

Harder to terminate runaway sessions

How PG Pilot detects it

```sql
SELECT name, setting
FROM pg_settings
WHERE name = 'superuser_reserved_connections';
```

How to fix it

1

Increase reserved connections

Reserve 3-5 connections for superusers:

ALTER SYSTEM SET superuser_reserved_connections = 5;

Requires restart.

2

Plan connection budget

Ensure max_connections accounts for reserved:

Available for apps = max_connections - superuser_reserved_connections

Prevention

  • Keep at least 3 reserved connections
  • Account for reserved connections when sizing pools
  • Test admin access during load testing

Related Issues

Related Features

PostgreSQL Documentation