Re: Experimental patch for inter-page delay in VACUUM - Mailing list pgsql-hackers

From Jan Wieck
Subject Re: Experimental patch for inter-page delay in VACUUM
Date
Msg-id 3FAFAF3E.8090108@Yahoo.com
Whole thread Raw
In response to Re: Experimental patch for inter-page delay in VACUUM  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:

> Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> Now, if we are sure that writes will happen only in the checkpoint
>> process, O_SYNC would be OK, I guess, but will we ever be sure of that?
> 
> This is a performance issue, not a correctness issue.  It's okay for
> backends to wait for writes as long as it happens very infrequently.
> The question is whether we can design a background dirty-buffer writer
> that works well enough to make it uncommon for backends to have to
> write dirty buffers for themselves.  If we can, then doing all the
> writes O_SYNC would not be a problem.
> 
> (One possibility that could help improve the odds is to allow a certain
> amount of slop in the LRU buffer reuse policy --- that is, if you see
> the buffer at the tail of the LRU list is dirty, allow one of the next
> few buffers to be taken instead, if it's clean.  Or just keep separate
> lists for dirty and clean buffers.)

If the checkpointer is writing in LRU order (which is the order buffers 
normally get replaced), this happening would mean that the backends have 
replaced all clean buffers at the LRU head and this can only happen if 
the currently running checkpointer is working way too slow. If it is 
more than 30 seconds away from its target finish time, it would be a 
good idea to restart by building a (guaranteed long now) new todo list 
and write faster (but starting again at the LRU head). If it's too late 
for that, stop napping, finish this checkpoint NOW and start a new one 
immediately.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



pgsql-hackers by date:

Previous
From: Robert Treat
Date:
Subject: Re: [pgsql-www] Changes to Contributor List
Next
From: "Welly"
Date:
Subject: Unable to load libsqlpg.so