# max_worker_processes

> max_worker_processes — Maximum number of concurrent worker processes. Observed in PG9.4–19 Beta 3; its last measured boot default is 8 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 concurrent worker processes.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `integer` | Upstream pg_settings type |
| Context | `postmaster` | Requires a server restart |
| Unit | — | Raw unit |
| Range | `0` – `262143` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Resource Usage / Worker Processes | Upstream classification |
| Latest boot value | `8` | 8 |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.4 |
| Present in | PG9.4–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`6bc8ef0b7f1f`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=6bc8ef0b7f1f1df3998745a66e1790e27424aa0c) — Add new GUC, max_worker_processes, limiting number of bgworkers. |
| Commit date | 2013-07-04 |
| Discussion | — |

## Default history {#default-history}

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

## How it works {#mechanism}

max_worker_processes is the startup-time ceiling for concurrent background worker processes, including parallel workers and extension-managed workers. It is broader than max_parallel_workers.

The setting allocates shared control capacity but does not launch workers. Replication, extensions, logical apply, and parallel execution can all depend on slots beneath this ceiling.

A standby should normally configure the same or a higher value than its primary because worker requirements can be replayed or promoted. Increasing it without a CPU and memory budget only creates possible concurrency. Its postmaster context fixes the value at server start; changing it requires a restart.

## Tuning advice {#tuning-advice}

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

| Workload | Guidance |
| --- | --- |
| OLTP | Set max_worker_processes from a concurrency budget, not core count alone. Protect latency-sensitive OLTP from report and maintenance bursts, and verify actual Workers Planned versus Workers Launched. |
| OLAP | Analytical work can use a larger max_worker_processes, but multiply per-node memory and I/O by concurrent statements. Benchmark throughput under realistic worker contention rather than one isolated query. |
| Small nodes | Keep max_worker_processes conservative on a small host. More possible workers can reduce throughput through context switching and memory pressure even when a single query becomes faster. |
{.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 | `24` | different | `{{ pg_max_worker_processes + 8 }}` |
| OLAP | `28` | different | `{{ pg_max_worker_processes + 8 }}` |
| CRIT | `24` | different | `{{ pg_max_worker_processes + 8 }}` |
| TINY | `20` | different | `{{ pg_max_worker_processes + 8 }}` |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG9.4–19 Beta 3 = 24 (dcs); OLAP: PG9.4–19 Beta 3 = 28 (dcs); CRIT: PG9.4–19 Beta 3 = 24 (dcs); TINY: PG9.4–19 Beta 3 = 20 (dcs). Advice, pending human review — Editorial inference, pending maintainer review: The template expression adds worker headroom above its profile variable, likely reserving slots for extensions, replication, and parallel work; the exact capacity model needs maintainer confirmation.

## Common pitfalls {#common-pitfalls}

- Treating max_worker_processes as reserved capacity rather than an upper bound shared with other work.
- Ignoring that parallel plans multiply CPU, I/O, and work_mem-limited nodes.
- Benchmarking one query without concurrent worker contention.
- Assuming planned workers will always be launched at execution time.

## Related parameters {#related-parameters}

[`max_parallel_workers`](/parameters/max-parallel-workers/) · [`max_parallel_workers_per_gather`](/parameters/max-parallel-workers-per-gather/) · [`max_parallel_maintenance_workers`](/parameters/max-parallel-maintenance-workers/) · [`max_logical_replication_workers`](/parameters/max-logical-replication-workers/) · [`max_wal_senders`](/parameters/max-wal-senders/)

## References {#references}

- [PostgreSQL 19 Beta 3 — max_worker_processes](https://www.postgresql.org/docs/19/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
