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

From Bruce Momjian
Subject Re: Experimental patch for inter-page delay in VACUUM
Date
Msg-id 200311101851.hAAIpxN22423@candle.pha.pa.us
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.

Agreed.  My concern is that right now we do write() in each backend. 
Those writes are probably pretty fast, probably as fast as a read() when
the buffer is already in the kernel cache.  The current discussion
involves centralizing most of the writes (centralization can be slower),
and having the writes forced to disk.  That seems like it could be a
double-killer.

> (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.)

Yes, I think you almost will have to split the LRU list into
dirty/clean, and that might make dirty buffers stay around longer.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Experimental patch for inter-page delay in VACUUM
Next
From: Bruce Momjian
Date:
Subject: Re: Experimental patch for inter-page delay in VACUUM