Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id EC1C01337B50 for ; Mon, 1 Nov 2010 02:03:49 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 69715-02 for ; Mon, 1 Nov 2010 05:03:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.catalyst.net.nz (bertrand.catalyst.net.nz [202.78.240.40]) by mail.postgresql.org (Postfix) with ESMTP id 60BB41337B4A for ; Mon, 1 Nov 2010 02:03:41 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id 84CDD6766D for ; Mon, 1 Nov 2010 18:03:36 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S2smJHhvAdVI for ; Mon, 1 Nov 2010 18:03:35 +1300 (NZDT) Received: from [192.168.1.11] (122-58-208-29.jetstream.xtra.co.nz [122.58.208.29]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id A6CA031D49 for ; Mon, 1 Nov 2010 18:03:34 +1300 (NZDT) Message-ID: <4CCE4A25.8050803@catalyst.net.nz> Date: Mon, 01 Nov 2010 18:03:33 +1300 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Thunderbird/3.0.10 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1? References: <4CCDCAA3.4050805@2ndquadrant.com> In-Reply-To: <4CCDCAA3.4050805@2ndquadrant.com> Content-Type: multipart/alternative; boundary="------------060507070406090804010201" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/1 X-Sequence-Number: 41025 This is a multi-part message in MIME format. --------------060507070406090804010201 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 01/11/10 08:59, Greg Smith wrote: > Marti Raudsepp wrote: >> Unless fdatasync is unsafe, I'd very much want to see it as the >> default for 9.1 on Linux (I don't know about other platforms). I >> can't see any reasons why each write would need to be sync-ed if I >> don't commit that often. Increasing wal_buffers probably has the same >> effect wrt data safety. > > Writes only are sync'd out when you do a commit, or the database does > a checkpoint. > > This issue is a performance difference introduced by a recent change > to Linux. open_datasync support was just added to Linux itself very > recently. It may be more safe than fdatasync on your platform. As > new code it may have bugs so that it doesn't really work at all under > heavy load. No one has really run those tests yet. See > http://wiki.postgresql.org/wiki/Reliable_Writes for some background, > and welcome to the fun of being an early adopter. The warnings in the > tuning guide are there for a reason--you're in untested territory > now. I haven't finished validating whether I consider 2.6.32 safe for > production use or not yet, and 2.6.36 is a solid year away from being > on my list for even considering it as a production database kernel. > You should proceed presuming that all writes are unreliable until > proven otherwise. > Greg, Your reply is possibly a bit confusingly worded - Marti was suggesting that fdatasync be the default - so he wouldn't be a new adopter, since this call has been implemented in the kernel for ages. I guess you were wanting to stress that *open_datasync* is the new kid, so watch out to see if he bites... Cheers Mark --------------060507070406090804010201 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit On 01/11/10 08:59, Greg Smith wrote:
Marti Raudsepp wrote:
Unless fdatasync is unsafe, I'd very much want to see it as the
default for 9.1 on Linux (I don't know about other platforms).  I
can't see any reasons why each write would need to be sync-ed if I
don't commit that often. Increasing wal_buffers probably has the same
effect wrt data safety.
 

Writes only are sync'd out when you do a commit, or the database does a checkpoint.

This issue is a performance difference introduced by a recent change to Linux.  open_datasync support was just added to Linux itself very recently.  It may be more safe than fdatasync on your platform.  As new code it may have bugs so that it doesn't really work at all under heavy load.  No one has really run those tests yet.  See http://wiki.postgresql.org/wiki/Reliable_Writes for some background, and welcome to the fun of being an early adopter.  The warnings in the tuning guide are there for a reason--you're in untested territory now.  I haven't finished validating whether I consider 2.6.32 safe for production use or not yet, and 2.6.36 is a solid year away from being on my list for even considering it as a production database kernel.  You should proceed presuming that all writes are unreliable until proven otherwise.


Greg,

Your reply is possibly a bit confusingly worded - Marti was suggesting that fdatasync be the default - so he wouldn't be a new adopter, since this call has been implemented in the kernel for ages. I guess you were wanting to stress that *open_datasync* is the new kid, so watch out to see if he bites...

Cheers

Mark
--------------060507070406090804010201--