From: Bruce Momjian Date: Mon, 16 Nov 2020 18:13:43 +0000 (-0500) Subject: doc: update bgwriter description X-Git-Tag: REL9_5_25~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a39de0c415fa6f0e215c97e4d587aaa6482174ca;p=thirdparty%2Fpostgresql.git doc: update bgwriter description This clarifies exactly what the bgwriter does, which should help with tuning. Reported-by: Chris Wilson Discussion: https://postgr.es/m/160399562040.7809.7335281028960123489@wrigleys.postgresql.org Backpatch-through: 9.5 --- diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 7e4d8c39257..9b108abdbf5 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -1781,8 +1781,11 @@ include_dir 'conf.d' There is a separate server process called the background writer, whose function is to issue writes of dirty (new or modified) shared - buffers. It writes shared buffers so server processes handling - user queries seldom or never need to wait for a write to occur. + buffers. When the number of clean shared buffers appears to be + insufficient, the background writer writes some dirty buffers to the + file system and marks them as clean. This reduces the likelihood + that server processes handling user queries will be unable to find + clean buffers and have to write dirty buffers themselves. However, the background writer does cause a net overall increase in I/O load, because while a repeatedly-dirtied page might otherwise be written only once per checkpoint interval, the