Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I think the ideal solution would be to remove bgwriter_percent or change
> > it to be a percentage of all buffers, not just dirty buffers, so we
> > don't have to scan the entire list. If we set the new value to 10% with
> > a delay of 1 second, and the bgwriter remembers the place it stopped
> > scanning the buffer cache, you will clean out the buffer cache
> > completely every 10 seconds.
> But we don't *want* it to clean out the buffer cache completely.
You are only cleaning out in pieces over a 10 second period so it is
getting dirty. You are not scanning the entire buffer at one time.
> There's no point in writing a "hot" page every few seconds. So I don't
> think I believe in remembering where we stopped anyway.
I was thinking if you are doing this scanning every X milliseconds then
after a while the front of the buffer cache will be mostly clean and the
end will be dirty so you will always be going over the same early ones
to get to the later dirty ones. Remembering the location gives the scan
more uniform coverage of the buffer cache.
You need a "clock sweep" like BSD uses (and probably others).
> I think there's a reasonable case to be made for redefining
> bgwriter_percent as the max percent of the total buffer list to scan
> (not the max percent of the list to return --- Jan correctly pointed out
> that the latter is useless). Then we could modify
> StrategyDirtyBufferList so that the percent and maxpages parameters are
> passed in, so it can stop as soon as either one is satisfied. This
> would be a fairly small/safe code change and I wouldn't have a problem
> doing it even at this late stage of the cycle.
> Howeve ... we would have to crank up the default bgwriter_percent,
> and I don't know if we have any better idea what to set it to after
> such a change than we do now ...
Once we make the change we will have to get our testers working on it.
We need those figure to change over time based on backends doing writes
but ath isn't going to happen for 8.0.
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
In response to
pgsql-hackers by date
|Next:||From: Bruce Momjian||Date: 2004-12-21 03:48:06|
|Subject: Re: rc1 packaged ...|
|Previous:||From: Mike G||Date: 2004-12-21 03:38:23|
|Subject: Re: Dump from cygwin directly to windows|