// postgresql · wal, redo & durability

max_wal_senders

How many clients can stream WAL from this server at the same time.

Padrão
10
Range
0 to 262143
Restart needed
Sim
Default checked on
PostgreSQL 18

O que faz

Each physical standby, pg_basebackup run and logical replication subscriber holds one sender process while it works, and wal_level = minimal requires this to be 0. A streaming client that disconnects abruptly can hold its sender slot until wal_sender_timeout (60s) expires.

Valor padrão

10. 10 (PostgreSQL 18), unchanged since PostgreSQL 10.

Check the current value

SHOW max_wal_senders;

SELECT setting, unit, boot_val, context, source, pending_restart
FROM pg_settings
WHERE name = 'max_wal_senders';

Change it

ALTER SYSTEM SET max_wal_senders = 20;
-- applies only after a server restart

Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.

When to change it

Count one per concurrent standby plus one per base backup in flight, then add headroom for reconnects; the docs suggest setting it slightly above the expected client count for exactly that orphaned-slot reason.

What can go wrong

Run out and a standby or pg_basebackup connect fails with 'number of requested standby connections exceeds max_wal_senders'. A value of 0 disables replication outright, and with wal_level = minimal the server refuses to start unless this is 0.

Questions about max_wal_senders

What is the default value of max_wal_senders in PostgreSQL?

10. 10 (PostgreSQL 18), unchanged since PostgreSQL 10.

Does changing max_wal_senders require a restart?

Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.

When should I change max_wal_senders?

Count one per concurrent standby plus one per base backup in flight, then add headroom for reconnects; the docs suggest setting it slightly above the expected client count for exactly that orphaned-slot reason.

Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.

// one client for every engine

Check max_wal_senders on your own server

SQLly runs the query above against PostgreSQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.

Texto e dados desta página: CC BY 4.0, com crédito ao SQLly (sqlly.app). Código e trechos SQL: MIT. Detalhes da licença