DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Resource Usage / Background Writer

bgwriter_lru_multiplier

Multiple of the average buffer usage to free per round.

  • Default: 2
  • Type: real
  • Range: 0 … 10
  • Applies: Reload

In plain words

The background writer looks at how many buffers sessions needed recently and prepares that many times this multiplier as clean buffers. 1.0 is "just in time", 2.0 leaves a cushion for spikes, 0 leaves almost all the writing to the sessions.

For DBAs and operators

The estimate uses a smoothed average of recent buffer allocations (buffers_alloc in pg_stat_bgwriter). The bgwriter then writes dirty buffers until estimate × multiplier reusable buffers are ahead of the clock sweep, capped by bgwriter_lru_maxpages. Larger values absorb bursts (fewer backend writes) at the price of extra writes for pages that get dirtied again. Values 2–5 are typical for write-heavy OLTP; it has little effect if maxpages is the limiting factor (check maxwritten_clean).

How to change it

Change in postgresql.conf or ALTER SYSTEM, then run SELECT pg_reload_conf().

See it in context

Background writer Buffer manager internals

Related parameters

bgwriter_lru_maxpages bgwriter_delay

All Resource Usage parameters