pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Mielke <mark@mark.mielke.cc>
To: Greg Smith <greg@2ndquadrant.com>
Cc: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
Cc: pgsql-performance@postgresql.org
Subject: Re: wal_synch_method = open_sync safe on RHEL 5.5?
Date: Thu, 17 Jun 2010 23:36:03 -0400
Message-ID: <4C1AE9A3.4080307@mark.mielke.cc> (raw)
In-Reply-To: <4C1AE820.6020506@2ndquadrant.com>
References: <4C1ACE5F.1080802@catalyst.net.nz>
	<4C1AE820.6020506@2ndquadrant.com>

The conclusion I read was that Linux O_SYNC behaves like O_DSYNC on 
other systems. For WAL, this seems satisfactory?

Personally, I use fdatasync(). I wasn't able to measure a reliable 
difference for my far more smaller databases, and fdatasync() seems 
reliable and fast enough, that fighting with O_SYNC doesn't seem to be 
worth it. Also, technically speaking, fdatasync() appeals more to me, as 
it allows the system to buffer while it can, and the application to 
instruct it across what boundaries it should not buffer. O_SYNC / 
O_DSYNC seem to imply a requirement that it does a synch on every block. 
My gut tells me that fdatasync() gives the operating system more 
opportunities to optimize (whether it does or not is a different issue 
:-) ).

Cheers,
mark


On 06/17/2010 11:29 PM, Greg Smith wrote:
> Mark Kirkwood wrote:
>> Now I recall some discussion about this enabling direct io and the 
>> general flakiness of this on Linux, so is the option regarded as safe?
>
> No one has ever refuted the claims in 
> http://archives.postgresql.org/pgsql-hackers/2007-10/msg01310.php that 
> it can be unsafe under a heavy enough level of mixed load on RHEL5.  
> Given the performance benefits are marginal on ext3, I haven't ever 
> considered it worth the risk.  (I've seen much larger gains on 
> Linux+Veritas VxFS).  From what I've seen, recent Linux kernel work 
> has reinforced that the old O_SYNC implementation was full of bugs now 
> that more work is being done to improve that area.  My suspicion 
> (based on no particular data, just what I've seen it tested with) is 
> that it only really worked before in the very specific way that Oracle 
> does O_SYNC writes, which is different from what PostgreSQL does.
>
> P.S. Be wary of expecting pgbench to give you useful numbers on a 
> single run.  For the default write-heavy test, I recommend three runs 
> of 10 minutes each (-T 600 on recent PostgreSQL versions) before I 
> trust any results it gives.  You can get useful data from the 
> select-only test in only a few seconds, but not the one that writes a 
> bunch.
>
> -- 
> Greg Smith  2ndQuadrant US  Baltimore, MD
> PostgreSQL Training, Services and Support
> greg@2ndQuadrant.com    www.2ndQuadrant.us
>    


-- 
Mark Mielke<mark@mielke.cc>

view thread (5+ messages)  latest in thread

Message-ID: <4C1AE9A3.4080307@mark.mielke.cc>
Permalink:  ../4C1AE9A3.4080307@mark.mielke.cc/
Also on:    postgresql.org/message-id/4C1AE9A3.4080307@mark.mielke.cc

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: mark@mark.mielke.cc, greg@2ndquadrant.com, mark.kirkwood@catalyst.net.nz
  Subject: Re: wal_synch_method = open_sync safe on RHEL 5.5?
  In-Reply-To: <4C1AE9A3.4080307@mark.mielke.cc>

* 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