Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 7D8A1632867 for ; Mon, 16 Aug 2010 18:06:05 -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 66164-06 for ; Mon, 16 Aug 2010 21:05:57 +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 76DE96327A7 for ; Mon, 16 Aug 2010 18:05:58 -0300 (ADT) Received: by mail.anarazel.de (Postfix, from userid 108) id 660C044800B; Mon, 16 Aug 2010 23:05:56 +0200 (CEST) Received: from anarazel.de (e178215009.adsl.alicedsl.de [85.178.215.9]) by mail.anarazel.de (Postfix) with ESMTPSA id 360EE448004; Mon, 16 Aug 2010 23:05:53 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id 3AA1B1C00A7; Mon, 16 Aug 2010 23:05:52 +0200 (CEST) Date: Mon, 16 Aug 2010 23:05:52 +0200 From: Andres Freund To: Greg Smith Cc: Scott Carey , Bruce Momjian , Kenneth Cox , "pgsql-performance@postgresql.org" Subject: Re: Advice configuring ServeRAID 8k for performance Message-ID: <20100816210552.GC3911@anarazel.de> References: <201008131817.o7DIH1b03550@momjian.us> <4C6591D9.1080206@2ndquadrant.com> <5687A8AD-CA70-4272-A32C-6AE5F491CEA4@richrelevance.com> <4C69796D.9000408@2ndquadrant.com> <20100816200227.GA3911@anarazel.de> <4C699BE2.50606@2ndquadrant.com> <20100816201838.GB3911@anarazel.de> <4C69A57B.80605@2ndquadrant.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C69A57B.80605@2ndquadrant.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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/163 X-Sequence-Number: 40006 On Mon, Aug 16, 2010 at 04:54:19PM -0400, Greg Smith wrote: > Andres Freund wrote: > >A new checkpointing logic + a new syncing logic > >(prepare_fsync() earlier and then fsync() later) would be a nice > >thing. Do you plan to work on that? > The background writer already caches fsync calls into a queue, so > the prepare step you're thinking needs to be there is already. The > problem is that the actual fsync calls happen in a tight loop. That > we're busy fixing. That doesn't help that much on many systems with a somewhat deep queue. 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. Which, in a simplified case, turns the earlier needed multiple barriers into a single one (in practise you want to call fsync() anyway, but thats not a big problem if its already written out). Andres