Configuration parameter

max_logical_replication_workers — PostgreSQL configuration parameter

Category Replication

Specifies maximum number of logical replication workers.

At a glance

Property Value
Parameter max_logical_replication_workers
Category Replication
Default 4
Value type integer
Change scope Per-session (SET)
Available in PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12)

What it does

Specifies maximum number of logical replication workers. This includes leader apply workers, parallel apply workers, and table/sequence synchronization workers.

Logical replication workers are taken from the pool defined by max_worker_processes.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.

Inspect the current value and source with SHOW max_logical_replication_workers; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'max_logical_replication_workers';.

Tuning guidance

Size it to the number of subscriptions plus desired parallel apply/sync workers; it is drawn from max_worker_processes, so raise that too. Too low serializes subscription apply.

Reference

PostgreSQL documentation — max_logical_replication_workers.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters