Re: Experimental patch for inter-page delay in VACUUM

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Experimental patch for inter-page delay in VACUUM
Date: 2003-11-10 15:31:10
Message-ID: 3FAFAF3E.8090108@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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(at)Yahoo(dot)com #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2003-11-10 15:31:42 Re: [HACKERS] Changes to Contributor List
Previous Message Jan Wieck 2003-11-10 15:18:38 Re: Experimental patch for inter-page delay in VACUUM