{"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"}],"derived_content_hash":"55866cdf43ae1359ae596a725f27f42091a274bfa1c2fa45dcb57711fbdd7244","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:af868e5e3d769f5acde59ad80170d4ee89cd86ba12248d9105fd8306e29b6c62","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"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"],"repair_provenance":{"original_source_revision":"english-manuals:0297287b6489b01675667a8af2b7231f273db532f6faa65eba6dd2e2790c00f8","receipt_sha256":"c230d9272ff9606359bc184bf3f3b934e8554cdb0e39ddc4426dca200f4c5500","repair":"wiki-repair-20261023"},"short_desc":"Specifies maximum number of logical replication workers.","short_desc_zh":"","source_rev":"wiki-repair-20261023:af868e5e3d769f5acde59ad80170d4ee89cd86ba12248d9105fd8306e29b6c62","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"max_logical_replication_workers","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"max_logical_replication_workers","SourceRevision":"wiki-repair-20261023:af868e5e3d769f5acde59ad80170d4ee89cd86ba12248d9105fd8306e29b6c62","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.","description_zh":"指定逻辑复制工作进程的最大数量，其中包括领导者应用工作进程、并行应用工作进程和表同步工作进程。 逻辑复制工作进程来自 max_worker_processes 定义的进程池。 默认值是 4。此参数只能在服务器启动时设置。","description_zh_html":"\u003cp\u003e\n        指定逻辑复制工作进程的最大数量，其中包括领导者应用工作进程、并行应用工作进程和表同步工作进程。\n       \u003c/p\u003e\u003cp\u003e\n        逻辑复制工作进程来自 \u003ccode class=\"varname\"\u003emax_worker_processes\u003c/code\u003e 定义的进程池。\n       \u003c/p\u003e\u003cp\u003e\n        默认值是 4。此参数只能在服务器启动时设置。\n       \u003c/p\u003e","doc":{"anchor":"GUC-MAX-LOGICAL-REPLICATION-WORKERS","file":"runtime-config-replication.html","lang":"en","sha256":"c0b8bd86131ec62d4df97ce480d004aa7e3544477d053f0c2d4047b9edad5cc0","slug":"18"},"doc_html":"\u003cp\u003e\n        Specifies maximum number of logical replication workers. This includes\n        leader apply workers, parallel apply workers, and table synchronization\n        workers.\n       \u003c/p\u003e\u003cp\u003e\n        Logical replication workers are taken from the pool defined by\n        \u003ccode class=\"varname\"\u003emax_worker_processes\u003c/code\u003e.\n       \u003c/p\u003e\u003cp\u003e\n        The default value is 4. This parameter can only be set at server\n        start.\n       \u003c/p\u003e","doc_same_as":"","documentation_revision":{"inputs":[{"file":"runtime-config-replication.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"c0b8bd86131ec62d4df97ce480d004aa7e3544477d053f0c2d4047b9edad5cc0","version":"18.7"},{"file":"runtime-config-replication.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"83907b5f469e979a7b9ec875b5e7bdaa2ef6b85596ca31b45174f68cd7398b18","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"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","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-replication.html","sha256":"52bd5892f7e5511d05f46fc0c13a017de85307c674a9014948eb4ad480326c15"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"integer","zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"GUC-MAX-LOGICAL-REPLICATION-WORKERS","file":"runtime-config-replication.html","lang":"en","sha256":"c0b8bd86131ec62d4df97ce480d004aa7e3544477d053f0c2d4047b9edad5cc0","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\u003e\n        Specifies maximum number of logical replication workers. This includes\n        leader apply workers, parallel apply workers, and table synchronization\n        workers.\n       \u003c/p\u003e\u003cp\u003e\n        Logical replication workers are taken from the pool defined by\n        \u003ccode\u003emax_worker_processes\u003c/code\u003e.\n       \u003c/p\u003e\u003cp\u003e\n        The default value is 4. This parameter can only be set at server\n        start.\n       \u003c/p\u003e","SourceRevision":"wiki-repair-20261023:af868e5e3d769f5acde59ad80170d4ee89cd86ba12248d9105fd8306e29b6c62","ContentHash":"083fe9b4917ad0d2031e9d4ed418a2092fc008245c5705cf9cfbbc094fa81f3e","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":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
