# wal_skip_threshold

> wal_skip_threshold sets the minimum size of new file to fsync instead of writing WAL. It is a user setting present in PG13–18; the latest recorded boot default is 2 MiB.
---

> [!NOTE]
> **Fact — official short description:** “Minimum size of new file to fsync instead of writing WAL.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `integer` | Upstream pg_settings type |
| Context | `user` | Settable by an ordinary user |
| Unit | `kB` | Raw unit |
| Range | `0` – `2147483647` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Write-Ahead Log / Settings | Upstream classification |
| Latest boot value | `2048` | 2 MiB |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG13 |
| Present in | PG13–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`cb2fd7eac285`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=cb2fd7eac285b1b0a24eeb2b8ed4456b66c5a09f) — Skip WAL for new relfilenodes, under wal_level=minimal. |
| Commit date | 2020-03-21 |
| Discussion | [thread 1](https://postgr.es/m/20150702220524.GA9392@svana.org) |

## Default history {#default-history}

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

## How it works {#mechanism}

Minimum size of new file to fsync instead of writing WAL. It can be changed at session scope, so different sessions may observe different behavior.

Only at wal_level=minimal, creating or rewriting a permanent relation can either WAL-log its new data or fsync the files directly. This threshold chooses fsync for larger relations and has no effect at replica or logical levels.

Monitor and change wal_skip_threshold together with commit_delay, commit_siblings, fsync. Validate on the relevant server role and real workload, then use its user 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 | Establish durability and recovery objectives first, then tune wal_skip_threshold 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. |
{.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 | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG13–19 Beta 3 unmodified; OLAP: PG13–19 Beta 3 unmodified; CRIT: PG13–19 Beta 3 unmodified; TINY: PG13–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Tuning it at wal_level=replica or logical, where the setting has no effect.
- Applying it to ordinary row changes even though it concerns newly created or rewritten relation files.
- Reading an unqualified value as bytes instead of kilobytes.
- Choosing fsync versus WAL logging without benchmarking the actual storage and concurrent-commit impact.

## Related parameters {#related-parameters}

[`commit_delay`](/parameters/commit-delay/) · [`commit_siblings`](/parameters/commit-siblings/) · [`fsync`](/parameters/fsync/) · [`full_page_writes`](/parameters/full-page-writes/) · [`synchronous_commit`](/parameters/synchronous-commit/) · [`wal_buffers`](/parameters/wal-buffers/)

## References {#references}

- [PostgreSQL 19 Beta 3 — wal_skip_threshold](https://www.postgresql.org/docs/19/runtime-config-wal.html#GUC-WAL-SKIP-THRESHOLD)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
