{"Entry":{"collection":"guc","key":"max_logical_replication_workers","name":"max_logical_replication_workers","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Replication / Subscribers","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"9.6","status":"added","to":"10"},{"documentation_changed":true,"fields":{},"from":"15","status":"changed","to":"16"},{"documentation_changed":true,"fields":{},"from":"18","status":"changed","to":"19"}],"content_hash":"73417426a95bc2b328bfa94ba3964530b31a90b131ba4508f05fb4b7f2c94148","context":"","default_changed_in":[],"default_history":[{"from":"10","to":"19","value":"4"}],"editorial":{"advice":{"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.","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.","small":"Configure only replication capacity that is actually used. Even a small topology needs bounded timeouts and slot lifecycle; unlimited retention is not reliability."},"mechanism":["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."],"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."],"references":[{"title":"PostgreSQL 19 Beta 4: max_logical_replication_workers","url":"https://www.postgresql.org/docs/19/runtime-config-replication.html#GUC-MAX-LOGICAL-REPLICATION-WORKERS"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["max_parallel_apply_workers_per_subscription","max_sync_workers_per_subscription","max_worker_processes","max_replication_slots","max_active_replication_origins","track_commit_timestamp"],"summary":"max_logical_replication_workers — Maximum number of logical replication worker processes. Observed in PG10–19 Beta 4; its last measured boot default is 4 in PG19 Beta 4, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"10","group":"Replication","group_slug":"replication","imported_at":"2026-09-27T17:57:31.705539+08:00","intro_commit":{"authored_at":"2017-01-19T12:00:00-05:00","discussion":[],"hash":"665d1fad99e7b11678b0d5fa24d2898424243cd6","subject":"Logical replication","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=665d1fad99e7b11678b0d5fa24d2898424243cd6"},"key":"max_logical_replication_workers","last_version":"20","max_val":"","min_val":"","name":"max_logical_replication_workers","position":271,"present_in":["10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"Specifies maximum number of logical replication workers.","short_desc_zh":"","source_rev":"english-manuals:0297287b6489b01675667a8af2b7231f273db532f6faa65eba6dd2e2790c00f8","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"max_logical_replication_workers","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"max_logical_replication_workers","SourceRevision":"english-manuals:0297287b6489b01675667a8af2b7231f273db532f6faa65eba6dd2e2790c00f8","Facts":{"boot_val":"4","category":"Replication / Subscribers","context":"postmaster","description":"Specifies maximum number of logical replication workers. This includes leader apply workers, parallel apply workers, and table synchronization workers. Logical replication workers are taken from the pool defined by max_worker_processes. The default value is 4. This parameter can only be set at server start.","doc":{"anchor":"GUC-MAX-LOGICAL-REPLICATION-WORKERS","file":"runtime-config-replication.html","lang":"en","sha256":"c78480a202f8579e2655e080060afe4859c9eb26a16318fb9099dabb178fb32d","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"262143","metadata_version":"18","min_val":"0","name":"max_logical_replication_workers","short_desc":"Maximum number of logical replication worker processes.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-MAX-LOGICAL-REPLICATION-WORKERS","file":"runtime-config-replication.html","lang":"en","sha256":"c78480a202f8579e2655e080060afe4859c9eb26a16318fb9099dabb178fb32d","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"max_logical_replication_workers","SourceDatabase":"center","Version":"18","Locale":"en","Title":"max_logical_replication_workers","Summary":"Specifies maximum number of logical replication workers. This includes leader apply workers, parallel apply workers, and table synchronization workers. Logical replication workers are taken from the pool defined by max_worker_processes. The default value is 4. This parameter can only be set at server start.","BodyHTML":"\u003cp\u003eSpecifies maximum number of logical replication workers. This includes leader apply workers, parallel apply workers, and table synchronization workers. Logical replication workers are taken from the pool defined by max_worker_processes. The default value is 4. This parameter can only be set at server start.\u003c/p\u003e","SourceRevision":"english-manuals:0297287b6489b01675667a8af2b7231f273db532f6faa65eba6dd2e2790c00f8","ContentHash":"f547ea46c1a5b4e60e76743e29aa05594a3e8100407d724f204e6bea5537d4b1","Payload":{"description":"Specifies maximum number of logical replication workers. This includes leader apply workers, parallel apply workers, and table synchronization workers. Logical replication workers are taken from the pool defined by max_worker_processes. The default value is 4. This parameter can only be set at server start."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
