pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Gaetano Mendola <mendola@bigfoot.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
Date: Mon, 13 Sep 2004 21:28:09 -0400 (EDT)
Message-ID: <200409140128.i8E1S9i04905@candle.pha.pa.us> (raw)
In-Reply-To: <24308.1095110306@sss.pgh.pa.us>

Tom Lane wrote:
> The tests that started this thread are pretty unconvincing in my eyes,
> because they are comparing open_sync against code that fsyncs after each
> one-block write.  Under those circumstances, *of course* fsync will lose
> (or at least do no better), because it's forcing the same number of
> writes through a same-or-less-efficient API.  The reason that this isn't
> a trivial choice is that Postgres doesn't necessarily need to fsync
> after every block of WAL.  In particular, when doing large transactions
> there could be many blocks written between fsyncs, and in that case you
> could come out ahead with fsync because the kernel would have more
> freedom to schedule disk writes.

My guess is that the majority of queries do not fill more than one WAL
block.  Sure some do, but in those cases the fsync is probably small
compared to the duration of the query.  If we had a majority of queries
filling more than one block we would be checkpointing like crazy  and we
don't normally get reports about that.

-- 
  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, Pennsylvania 19073



view thread (10+ messages)  latest in thread

Message-ID: <200409140128.i8E1S9i04905@candle.pha.pa.us>
Permalink:  ../200409140128.i8E1S9i04905@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200409140128.i8E1S9i04905@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: pgman@candle.pha.pa.us, tgl@sss.pgh.pa.us, mendola@bigfoot.com
  Subject: Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
  In-Reply-To: <200409140128.i8E1S9i04905@candle.pha.pa.us>
  References: <24308.1095110306@sss.pgh.pa.us> <200409140128.i8E1S9i04905@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox