Re: Background LRU Writer/free list - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Background LRU Writer/free list
Date
Msg-id 5962.1176919353@sss.pgh.pa.us
Whole thread Raw
In response to Re: Background LRU Writer/free list  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: Background LRU Writer/free list
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> I had a thought on this. Instead of sleeping for a constant amount of time and
> then estimating the number of pages needed for that constant amount of time
> perhaps what bgwriter should be doing is sleeping for a variable amount of
> time and estimating the length of time it needs to sleep to arrive at a
> constant number of pages being needed.

That's an interesting idea, but a possible problem with it is that we
can't vary the granularity of a sleep time as finely as we can vary the
number of buffers processed per iteration.  Assuming that the system's
tick rate is the typical 100Hz, we have only 10ms resolution on sleep
times.

> The reason I think this may be better is that "what percentage of the shared
> buffers the bgwriter allows to get old between wakeups" seems more likely to
> be a universal constant that people won't have to adjust than "fixed time
> interval between bgwriter cleanup operations".

Why?  What you're really trying to determine, I think, is the I/O load
imposed by the bgwriter, and pages-per-second seems a pretty natural
way to think about that; percentage of shared buffers not so much.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Backend Crash
Next
From: David Fetter
Date:
Subject: Re: Can't ri_KeysEqual() consider two nulls as equal?