Re: Why BgWriterDelay is fixed? - Mailing list pgsql-general

From Peter Geoghegan
Subject Re: Why BgWriterDelay is fixed?
Date
Msg-id CAEYLb_WSi8usfQA0qoLrdme4O+S6-mjc_bbUqMXRRQgP+qPfrg@mail.gmail.com
Whole thread Raw
In response to Why BgWriterDelay is fixed?  (高健 <luckyjackgao@gmail.com>)
List pgsql-general
On 29 October 2012 07:17, 高健 <luckyjackgao@gmail.com> wrote:
> But I also found  the following in postgresql.conf:
> #bgwriter_delay = 200ms                 # 10-10000ms between rounds
> It is now comment .
> But according to the fixed code of  BgWriterDelay = 200, even when I update
> bgwriter_delay in postgresql.conf to a different value(eg 300ms),
> how can it ovewrite the fixed  200ms in bgwriter.c ?

That value is just a default, that we initialise the variable to as a
sort of a reminder. We do this all over the place. Setting
bgwriter_delay downwards will alter the frequency of iterations.

The WaitLatch() thing is purely concerned with keeping the number of
wake-ups low. As long as your database server does not idle, the logic
is effectively exactly the same as what you'll see in 9.1, where the
event loop is much simpler, and merely sleeps exactly bgwriter_delay
ms every iteration.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services


pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: How to print application_name in log_line_prefix (using %a)?
Next
From: Tom Lane
Date:
Subject: Re: Why BgWriterDelay is fixed?