# backend_flush_after

> backend_flush_after — Number of pages after which previously performed writes are flushed to disk. Observed in PG9.6–19 Beta 3; its last measured boot default is 0 B (0 × 8kB) in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
---

> [!NOTE]
> **Fact — official short description:** “Number of pages after which previously performed writes are flushed to disk.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `integer` | Upstream pg_settings type |
| Context | `user` | Settable by an ordinary user |
| Unit | `8kB` | Raw unit |
| Range | `0` – `256` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Resource Usage / I/O | Upstream classification |
| Latest boot value | `0` | 0 B (0 × 8kB) |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.6 |
| Present in | PG9.6–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`428b1d6b29ca`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=428b1d6b29ca599c5700d4bc4f4ce4c5880369bf) — Allow to trigger kernel writeback after a configurable number of writes. |
| Commit date | 2016-02-19 |
| Discussion | — |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG9.6–19 Beta 3 | `0` | `8kB` | 0 B (0 × 8kB) |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

After one backend has written more than backend_flush_after bytes, PostgreSQL asks the operating system to begin writing those dirty page-cache pages toward storage. Zero disables these writeback hints.

This is not fsync and does not make a transaction durable earlier. Its aim is to limit large dirty-page bursts and later stalls; support and effect depend on the operating system.

The threshold applies independently to each backend, so concurrent bulk writers can each generate writeback. It complements bgwriter_flush_after and checkpoint_flush_after, which cover different writer processes. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value.

## Tuning advice {#tuning-advice}

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

| Workload | Guidance |
| --- | --- |
| OLTP | Change backend_flush_after only after identifying the corresponding resource bottleneck under concurrency. Budget total memory, I/O, disk, or kernel capacity rather than optimizing one process in isolation. |
| OLAP | Benchmark backend_flush_after with representative bulk and scan phases. Include sustained throughput, spill/writeback, and interference with other sessions, not only one operation's elapsed time. |
| Small nodes | Keep backend_flush_after conservative on a small host and prefer the upstream default when evidence is weak. A setting copied from a large server can consume a disproportionate share of resources. |
{.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: PG9.6–19 Beta 3 unmodified; OLAP: PG9.6–19 Beta 3 unmodified; CRIT: PG9.6–19 Beta 3 unmodified; TINY: PG9.6–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Changing backend_flush_after without applying its documented unit and configuration context.
- Optimizing an isolated benchmark while ignoring concurrent aggregate resource use.
- Assuming a configured value guarantees operating-system or storage behavior.
- Failing to retest startup, failover, and workload latency after the change.

## Related parameters {#related-parameters}

[`bgwriter_flush_after`](/parameters/bgwriter-flush-after/) · [`checkpoint_flush_after`](/parameters/checkpoint-flush-after/) · [`bgwriter_delay`](/parameters/bgwriter-delay/) · [`shared_buffers`](/parameters/shared-buffers/) · [`track_io_timing`](/parameters/track-io-timing/)

## References {#references}

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