Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 1032963232D for ; Fri, 18 Jun 2010 00:29:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 38878-03 for ; Fri, 18 Jun 2010 03:29:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) by mail.postgresql.org (Postfix) with ESMTP id 7C4866322F9 for ; Fri, 18 Jun 2010 00:29:40 -0300 (ADT) Received: from [192.168.1.6] (pool-96-244-14-10.bltmmd.fios.verizon.net [96.244.14.10]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MIPfz-1OO4xp0Cel-0045gi; Fri, 18 Jun 2010 05:29:38 +0200 Message-ID: <4C1AE820.6020506@2ndquadrant.com> Date: Thu, 17 Jun 2010 23:29:36 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Mark Kirkwood CC: pgsql-performance@postgresql.org Subject: Re: wal_synch_method = open_sync safe on RHEL 5.5? References: <4C1ACE5F.1080802@catalyst.net.nz> In-Reply-To: <4C1ACE5F.1080802@catalyst.net.nz> Content-Type: multipart/alternative; boundary="------------080106020707040303080104" X-Provags-ID: V01U2FsdGVkX1+PlF92MHhnuJY1MPsfMpjIWE2UFSCjjJKwvlI IoI5riOUPknoJAGL7NDcqsTxfBbHPmocnhnlfez3WzqOwFtT97 AuR7aA+8GxscKOWYJ7svkiKDwRc7Fw7 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=-10 required=5 tests=BAYES_20=-0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201006/325 X-Sequence-Number: 39181 This is a multi-part message in MIME format. --------------080106020707040303080104 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------080106020707040303080104 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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
--------------080106020707040303080104--