Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 3D34863245F for ; Tue, 17 Aug 2010 06:37:50 -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 56794-04 for ; Tue, 17 Aug 2010 09:37:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.anarazel.de (mail.anarazel.de [217.115.131.40]) by mail.postgresql.org (Postfix) with ESMTP id CFD306322C3 for ; Tue, 17 Aug 2010 06:37:42 -0300 (ADT) Received: from alap2.localnet (p579FBBA9.dip.t-dialin.net [87.159.187.169]) by mail.anarazel.de (Postfix) with ESMTPSA id 40D17448006; Tue, 17 Aug 2010 11:37:40 +0200 (CEST) From: Andres Freund To: pgsql-performance@postgresql.org Subject: Re: Advice configuring ServeRAID 8k for performance Date: Tue, 17 Aug 2010 11:37:38 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.35-rc4-andres; KDE/4.5.0; x86_64; ; ) Cc: Greg Smith , Scott Carey , Bruce Momjian , Kenneth Cox References: <201008131817.o7DIH1b03550@momjian.us> <20100816210552.GC3911@anarazel.de> <4C6A4856.2050103@2ndquadrant.com> In-Reply-To: <4C6A4856.2050103@2ndquadrant.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201008171137.39078.andres@anarazel.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/172 X-Sequence-Number: 40015 On Tuesday 17 August 2010 10:29:10 Greg Smith wrote: > Andres Freund wrote: > > An fsync() equals a barrier so it has the effect of stopping > > reordering around it - especially on systems with larger multi-disk > > arrays thats pretty expensive. > > You can achieve surprising speedups, at least in my experience, by > > forcing the kernel to start writing out pages *without enforcing > > barriers* first and then later enforce a barrier to be sure its > > actually written out. > > Standard practice on high performance systems with good filesystems and > a battery-backed controller is to turn off barriers anyway. That's one > of the first things to tune on XFS for example, when you have a reliable > controller. I don't have enough data on ext4 to comment on tuning for > it yet. > > The sole purpose for the whole Linux write barrier implementation in my > world is to flush the drive's cache, when the database does writes onto > cheap SATA drives that will otherwise cache dangerously. Barriers don't > have any place on a serious system that I can see. The battery-backed > RAID controller you have to use to make fsync calls fast anyway can do > some simple write reordering, but the operating system doesn't ever have > enough visibility into what it's doing to make intelligent decisions > about that anyway. Even if were not talking about a write barrier in an "ensure its written out of the cache" way it still stops the io-scheduler from reordering. I benchmarked it (custom app) and it was very noticeable on a bunch of different systems (with a good BBUed RAID). Andres