Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 216F01337B69 for ; Sun, 31 Oct 2010 16:59:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 87179-08 for ; Sun, 31 Oct 2010 19:59:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by mail.postgresql.org (Postfix) with ESMTP id BEFF31337B8A for ; Sun, 31 Oct 2010 16:59:34 -0300 (ADT) Received: from [192.168.1.6] (static-71-179-240-8.bltmmd.fios.verizon.net [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MWxmu-1P78IS406W-00Vzz3; Sun, 31 Oct 2010 20:59:33 +0100 Message-ID: <4CCDCAA3.4050805@2ndquadrant.com> Date: Sun, 31 Oct 2010 15:59:31 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Marti Raudsepp CC: pgsql-performance@postgresql.org Subject: Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1? References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:kBX9T94kW2/UsbumsxIfJAMwsjjKnhgAu0G/v+lY747 Ya/xAkjEk8vk2ZsujHFI3eGfgQrT85/WNS1ubTY6uk1qhGCqXO Fh81jkMxve81sOi1NLdyFj0nTERzmgMKbQkKcgUdFiqpRmaSl4 iF76afgv+kUUKBxmWe8oVYpbzKBmqcNlS9kf21n+Sam00PL4uc lZ9GEYKTNaSpI/1oD9r2SUEcZAofiVogrfJFr9hvDg= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/604 X-Sequence-Number: 41022 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 Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services and Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books