Re: Spread checkpoint sync - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Spread checkpoint sync
Date
Msg-id 4D47F57C020000250003A0F5@gw.wicourts.gov
Whole thread Raw
In response to Re: Spread checkpoint sync  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Spread checkpoint sync  (Robert Haas <robertmhaas@gmail.com>)
Re: Spread checkpoint sync  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> wrote:
> I also think Bruce's idea of calling fsync() on each relation just
> *before* we start writing the pages from that relation might have
> some merit.
What bothers me about that is that you may have a lot of the same
dirty pages in the OS cache as the PostgreSQL cache, and you've just
ensured that the OS will write those *twice*.  I'm pretty sure that
the reason the aggressive background writer settings we use have not
caused any noticeable increase in OS disk writes is that many
PostgreSQL writes of the same buffer keep an OS buffer page from
becoming stale enough to get flushed until PostgreSQL writes to it
taper off.  Calling fsync() right before doing "one last push" of
the data could be really pessimal for some workloads.
-Kevin


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: SSI patch version 14
Next
From: Peter Eisentraut
Date:
Subject: Re: log_hostname and pg_stat_activity