wal_sync_method
Fact — official short description: “Selects the method used for forcing WAL updates to disk.”
Identity
Lifecycle
| Fact | Value |
|---|---|
| First observed | PG9.0 (research boundary) |
| Present in | PG9.0–19 Beta 3 |
| Removed in | No |
| Introduction commit | Not asserted: predates the PG9.0 research boundary |
| Commit date | — |
| Discussion | — |
Default history
| Versions | Raw boot_val |
Unit | Human value |
|---|---|---|---|
| PG9.0–19 Beta 3 | fdatasync |
— | fdatasync |
How it works
Selects the method used for forcing WAL updates to disk. A configuration reload applies a new value; existing work already in flight is not retroactively changed.
This chooses the operating-system primitive used to force WAL to durable storage, such as fdatasync, fsync, or open-sync variants. Availability and performance are platform/filesystem specific; all supported choices preserve the durability contract when the stack is honest.
Monitor and change wal_sync_method together with fsync, full_page_writes, synchronous_commit. 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
Advice. These are workload-specific starting points and must be validated with measurements.
| Workload | Guidance |
|---|---|
| OLTP | Establish durability and recovery objectives first, then tune wal_sync_method from WAL rate, flush latency, checkpoints, and peak pg_wal usage. Validate every change with crash/recovery and archive monitoring. |
| OLAP | Provision WAL, archive bandwidth, and recovery I/O for bulk-load peaks. Coordinate load pacing and checkpoints when reducing spikes; never break the recovery chain for throughput. |
| Small nodes | Start from safe defaults or the measured Pigsty value and set explicit alerts for limited disk capacity. Do not disable durability or break the recovery chain merely to save modest I/O. |
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 | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 unmodified; OLAP: PG9.0–19 Beta 3 unmodified; CRIT: PG9.0–19 Beta 3 unmodified; TINY: PG9.0–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.
Common pitfalls
- Selecting a method that the operating system or filesystem does not support.
- Benchmarking on a different kernel, mount option, or storage cache than production.
- Confusing write throughput with durable-sync latency.
- Changing the method without a crash/power-loss durability test.
- Assuming the fastest method on data files is also the best method for WAL.
Related parameters
fsync · full_page_writes · synchronous_commit · wal_buffers · wal_writer_delay · commit_delay