Re: Bgwriter strategies - Mailing list pgsql-hackers

From Greg Smith
Subject Re: Bgwriter strategies
Date
Msg-id Pine.GSO.4.64.0707060616490.3474@westnet.com
Whole thread Raw
In response to Re: Bgwriter strategies  (Heikki Linnakangas <heikki@enterprisedb.com>)
Responses Re: Bgwriter strategies  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-hackers
On Fri, 6 Jul 2007, Heikki Linnakangas wrote:

> To strike a balance between cleaning buffers ahead of possible bursts in the 
> future and not doing unnecessary I/O when no such bursts come, I think a 
> reasonable strategy is to write buffers with usage_count=0 at a slow pace 
> when there's no buffer allocations happening.

One idea I had there was to always scan max_pages buffers each time even 
if there were less allocations than needed for that.  That number is 
usually relatively small compared to the size of the buffer cache, so it 
would creep through the buffer cache at a bounded pace during idle 
periods.  It's actually nice to watch the LRU cleaner get so far ahead 
during idle spots that it catches the strategy point, so that when the 
next burst comes, it doesn't have to do anything until there's a full lap 
by the clock sweep.

Anyway, completely with you on the rest of this post, everything you said 
matches the direction I've been trudging toward.

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Checkpoints and buffers that are hint-bit-dirty
Next
From: Greg Smith
Date:
Subject: Tidied up patch status page