Re: RC2 and open issues

From: Richard Huxton <dev(at)archonet(dot)com>
To: simon(at)2ndquadrant(dot)com
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RC2 and open issues
Date: 2004-12-21 12:23:10
Message-ID: 41C815AE.7030908@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

simon(at)2ndquadrant(dot)com wrote:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote on 21.12.2004, 05:05:36:
>
>>Bruce Momjian writes:
>>
>>>I am confused. If we change the percentage to be X% of the entire
>>>buffer cache, and we set it to 1%, and we exit when either the dirty
>>>pages or % are reached, don't we end up just scanning the first 1% of
>>>the cache over and over again?
>>
>>Exactly. But 1% would be uselessly small with this definition. Offhand
>>I'd think something like 50% might be a starting point; maybe even more.
>>What that says is that a page isn't a candidate to be written out by the
>>bgwriter until it's fallen halfway down the LRU list.
>>
>
>
> I see the buffer list as a conveyor belt that carries unneeded blocks
> away from the MRU. Cleaning near the LRU (I agree: How near?) should be
> all that is sufficient to keep the list clean.
>
> Cleaning the first 1% "over and over again" makes it sound like it is
> the same list of blocks that are being cleaned. It may be the same
> linked list data structure, but that is dynamically changing to contain
> completely different blocks from the last time you looked.

However, one thing you can say is that if block B hasn't been written to
since you last checked, then any blocks older than that haven't been
written to either. Of course, the problem is in finding block B again
without re-scanning from the LRU end.

Is there any non-intrusive way we could add a "bookmark" into the
conveyer-belt? (mixing my metaphors again :-) Any blocks written to
would move up the cache, effectively moving the bookmark lower. Enough
activity would cause the bookmark to drop off the end. If that isn't the
case though, we know we can safely skip any blocks older than the bookmark.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kenneth Marshall 2004-12-21 13:09:50 Re: RC2 and open issues
Previous Message Zeugswetter Andreas DAZ SD 2004-12-21 11:18:58 Re: RC2 and open issues