Re: Spread checkpoint sync - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Spread checkpoint sync
Date
Msg-id 201102011830.p11IUC319445@momjian.us
Whole thread Raw
In response to Re: Spread checkpoint sync  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Spread checkpoint sync
List pgsql-hackers
Robert Haas wrote:
> Back to your idea: One problem with trying to bound the unflushed data
> is that it's not clear what the bound should be.  I've had this mental
> model where we want the OS to write out pages to disk, but that's not
> always true, per Greg Smith's recent posts about Linux kernel tuning
> slowing down VACUUM.  A possible advantage of the Momjian algorithm
> (as it's known in the literature) is that we don't actually start
> forcing anything out to disk until we have a reason to do so - namely,
> an impending checkpoint.

My trivial idea was:  let's assume we checkpoint every 10 minutes, and
it takes 5 minutes for us to write the data to the kernel.   If no one
else is writing to those files, we can safely wait maybe 5 more minutes
before issuing the fsync.  If, however, hundreds of writes are coming in
for the same files in those final 5 minutes, we should fsync right away.

My idea is that our delay between writes and fsync should somehow be
controlled by how many writes to the same files are coming to the kernel
while we are considering waiting because the only downside to delay is
the accumulation of non-critical writes coming into the kernel for the
same files we are going to fsync later.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: ALTER EXTENSION UPGRADE, v3
Next
From: "Kevin Grittner"
Date:
Subject: Re: SSI patch version 14