Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdGXQ-0002u7-BE for pgsql-docs@arkaria.postgresql.org; Thu, 12 Nov 2020 17:37:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kdGXP-0005cD-8C for pgsql-docs@arkaria.postgresql.org; Thu, 12 Nov 2020 17:37:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdGXP-0005c3-2X for pgsql-docs@lists.postgresql.org; Thu, 12 Nov 2020 17:37:35 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdGXM-0003BW-ML for pgsql-docs@lists.postgresql.org; Thu, 12 Nov 2020 17:37:34 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kdGXK-00069i-GN; Thu, 12 Nov 2020 12:37:30 -0500 Date: Thu, 12 Nov 2020 12:37:30 -0500 From: Bruce Momjian To: Chris Wilson Cc: Thomas Munro , Pg Docs Subject: Re: What does "[backends] should seldom or never need to wait for a write to occur" mean? Message-ID: <20201112173730.GF25584@momjian.us> References: <20201110013632.GA8789@momjian.us> <20201110160801.GA25651@momjian.us> <20201111232417.GH25840@momjian.us> <20201112165412.GC25584@momjian.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0ntfKIWw70PvrIHh" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0ntfKIWw70PvrIHh Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Thu, Nov 12, 2020 at 05:25:30PM +0000, Chris Wilson wrote: > Hi Bruce, > > Thanks, I absolutely agree that this documentation needs to explain properly > how the bgwriter works. Your latest patch looks good, it significantly improves > this section of the manual. I would just suggest changing "non-dirty" to > "clean" in "When the number of non-dirty shared buffers appears to be > insufficient", as this makes the language simpler and avoids introducing > another new term (non-dirty, which means the same as clean). OK, done. I wasn't sure 'clean' would be assumed to be non-dirty, but you are right the language is clearer with 'clean'. (I was afraid 'clean' would be assumed to be 'empty'.) -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee --0ntfKIWw70PvrIHh Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="bgwriter.diff" diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index f043433e31..a632cf98ba 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -2146,8 +2146,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 --0ntfKIWw70PvrIHh--