# max_sync_workers_per_subscription

> max_sync_workers_per_subscription — Maximum number of workers per subscription for synchronizing tables and sequences. Observed in PG10–19 Beta 3; its last measured boot default is 2 in PG19 Beta 3, with sighup context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
---

> [!NOTE]
> **Fact — official short description:** “Maximum number of workers per subscription for synchronizing tables and sequences.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `integer` | Upstream pg_settings type |
| Context | `sighup` | Takes effect after configuration reload |
| Unit | — | Raw unit |
| Range | `0` – `262143` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Replication / Subscribers | Upstream classification |
| Latest boot value | `2` | 2 |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG10 |
| Present in | PG10–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`7c4f52409a8c`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=7c4f52409a8c7d85ed169bbbc1f6092274d03920) — Logical replication support for initial data copy |
| Commit date | 2017-03-23 |
| Discussion | — |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG10–19 Beta 3 | `2` | — | 2 |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

Maximum number of table synchronization workers per subscription. A configuration reload applies a new value; existing work already in flight is not retroactively changed.

Initial table copies use synchronization workers up to this per-subscription ceiling. They share max_logical_replication_workers and max_worker_processes with apply workers, so the configured number is not a guaranteed concurrency level.

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

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| OLTP | Size max_sync_workers_per_subscription 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. |
{.full-width}

## Pigsty {#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 | `6` | different | `6` |
| OLAP | `6` | different | `6` |
| CRIT | `6` | different | `6` |
| TINY | `6` | different | `6` |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG10–19 Beta 3 = 6 (dcs); OLAP: PG10–19 Beta 3 = 6 (dcs); CRIT: PG10–19 Beta 3 = 6 (dcs); TINY: PG10–19 Beta 3 = 6 (dcs). Advice, pending human review — Editorial interpretation, pending human maintainer review: the override appears intended to accelerate initial logical-replication table copies within the global worker budget; confirm it against the current Pigsty templates, hardware fixture, and operational guarantees before publication.

## Common pitfalls {#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.

## Related parameters {#related-parameters}

[`max_logical_replication_workers`](/parameters/max-logical-replication-workers/) · [`max_parallel_apply_workers_per_subscription`](/parameters/max-parallel-apply-workers-per-subscription/) · [`max_worker_processes`](/parameters/max-worker-processes/) · [`max_replication_slots`](/parameters/max-replication-slots/) · [`max_active_replication_origins`](/parameters/max-active-replication-origins/) · [`hot_standby`](/parameters/hot-standby/)

## References {#references}

- [PostgreSQL 19 Beta 3 — max_sync_workers_per_subscription](https://www.postgresql.org/docs/19/runtime-config-replication.html#GUC-MAX-SYNC-WORKERS-PER-SUBSCRIPTION)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
