Parameter · Replication / Sending Servers
max_wal_senders
Sets the maximum number of simultaneously running WAL sender processes.
- Default:
10 - Type: integer
- Range: 0 … 262143
- Applies: Restart required
In plain words
Every standby, every logical replication subscriber and every pg_basebackup that streams WAL needs its own WAL sender process on this server. max_wal_senders is how many can run at once. When they are all in use, the next one is refused.
The default of 10 is fine for most systems. Leave some headroom: a backup tool or a reconnecting standby may briefly need an extra slot.
For DBAs and operators
WAL senders have their own process slots and do not count against max_connections (since PostgreSQL 12). A value above 0 requires wal_level ≥ replica; 0 disables replication and base backups entirely.
Refused connection, as the client sees it:
FATAL: number of requested standby connections exceeds "max_wal_senders" (currently 10)
pg_basebackup -X stream(the default) uses two senders: one for data, one for WAL.- A standby that lost its connection may hold its old sender for up to wal_sender_timeout, so a reconnect can briefly need an extra slot.
- On a hot standby the value must be ≥ the primary's; otherwise replay pauses with WARNING: hot standby is not possible because of insufficient parameter settings until the standby is reconfigured and restarted.
- The total
max_connections + autovacuum_worker_slots + max_worker_processes + max_wal_sendershas a hard upper limit: it must be less than 262142, otherwise the server does not start ("too many server processes configured").
SELECT pid, application_name, client_addr, state, sync_state
FROM pg_stat_replication;How to change it
Change in postgresql.conf or ALTER SYSTEM, then restart the server.
See it in context
WAL sender Streaming replication Logical replication Synchronous replication Logical decoding and ReorderBuffer
Related parameters
max_replication_slots wal_level wal_sender_timeout max_connections