Re: Why BgWriterDelay is fixed?

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: 高健 <luckyjackgao(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why BgWriterDelay is fixed?
Date: 2012-10-29 15:35:13
Message-ID: CAMkU=1z66t9oV9OBb2D1NYxW355SYgr0Q3Qp-VXhVYZGqW923A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Oct 29, 2012 at 12:17 AM, 高健 <luckyjackgao(at)gmail(dot)com> wrote:
> In src/backend/postmaster/bgwriter.c , I can find the following source
> code(PostgreSQL9.2):
>
>
> /*
> * GUC parameters
> */
> int BgWriterDelay = 200;

The value hard coded into the C code is the starting value, or
default. It is not a constant.

Indeed, I don't think that value is even used. I think that upon
start-up, that value gets set to the default listed in the guc.c file
(which is also 200), and so the value listed in the bgwriter.c file is
merely a mnemonic to remind people editing the file what the default
value is.

> 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 ?

Doing so is the job of the "grand unified configuration" machinery, in
src/backend/utils/misc/guc.c

Cheers,

Jeff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-10-29 15:58:12 Re: How to print application_name in log_line_prefix (using %a)?
Previous Message Chris Angelico 2012-10-29 13:57:28 Re: How to print application_name in log_line_prefix (using %a)?