Skip to content

max_logical_replication_workers

max_logical_replication_workers — Maximum number of logical replication worker processes. Observed in PG10–19 Beta 3; its last measured boot default is 4 in PG19 Beta 3, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
Note

Fact — official short description: “Maximum number of logical replication worker processes.”

Identity

Type , Valueinteger
Upstream pg_settings type
Context , Valuepostmaster
Requires a server restart
Unit , Value
Raw unit
Range , Value0262143
Raw limits in the last observed version
Enum values , Value
— for non-enum types
Category , ValueReplication / Subscribers
Upstream classification
Latest boot value , Value4
4

Lifecycle

Fact Value
First observed PG10
Present in PG10–19 Beta 3
Removed in No
Introduction commit 665d1fad99e7 — Logical replication
Commit date 2017-01-19
Discussion

Default history

Measured PG9.0–19 Beta 3 boot defaults
Versions Raw boot_val Unit Human value
PG10–19 Beta 3 4 4

How it works

Maximum number of logical replication worker processes. The value is fixed when the server starts, so changing it requires a restart.

This reserves the logical-replication portion of the background-worker budget for apply, table synchronization, and related workers. The effective capacity is also bounded by max_worker_processes and by the per-subscription worker limits.

Monitor and change max_logical_replication_workers together with max_parallel_apply_workers_per_subscription, max_sync_workers_per_subscription, max_worker_processes. Validate on the relevant server role and real workload, then use its postmaster context to choose session change, reload, or restart; a historical boot default is not the current effective value.

Tuning advice

Tip

Advice. These are workload-specific starting points and must be validated with measurements.

Workload Guidance
OLTP Size max_logical_replication_workers from topology, failover roles, slot/subscription count, and reconnect headroom. Test worst-case primary latency, standby replay, and disk retention before production.
OLAP Read standbys and logical subscribers often see long queries or large transactions. Put explicit bounds on replay/apply and monitor lag, worker saturation, slot restart_lsn, and conflict cancellations.
Small nodes Configure only replication capacity that is actually used. Even a small topology needs bounded timeouts and slot lifecycle; unlimited retention is not reliability.

Pigsty

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

Template Effective value Versus upstream boot Source expression
OLTP 8 different 8
OLAP 8 different 8
CRIT 8 different 8
TINY 8 different 8
Caution

Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG10–19 Beta 3 = 8 (dcs); OLAP: PG10–19 Beta 3 = 8 (dcs); CRIT: PG10–19 Beta 3 = 8 (dcs); TINY: PG10–19 Beta 3 = 8 (dcs). Advice, pending human review — Editorial interpretation, pending human maintainer review: the override appears intended to leave headroom for several logical subscriptions and table synchronization jobs; confirm it against the current Pigsty templates, hardware fixture, and operational guarantees before publication.

Common pitfalls

  • Changing it on the wrong primary, standby, sender, or subscriber role.
  • Watching only configured bytes/time instead of actual lag, slot position, and worker state.
  • Failing over to a node that lacks the old primary’s capacity or prerequisites.
  • Using infinite waits or WAL retention to hide a failed consumer.

max_parallel_apply_workers_per_subscription · max_sync_workers_per_subscription · max_worker_processes · max_replication_slots · max_active_replication_origins · track_commit_timestamp

References