Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id F005D2E00BC for ; Sun, 2 Mar 2008 00:17:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 80028-06 for ; Sun, 2 Mar 2008 00:17:20 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from westnet.com (westnet.com [216.187.52.2]) by postgresql.org (Postfix) with ESMTP id 3FF6A2E00F0 for ; Sun, 2 Mar 2008 00:17:20 -0400 (AST) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id m224HIEr012320; Sat, 1 Mar 2008 23:17:18 -0500 (EST) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id m224HIuQ012315; Sat, 1 Mar 2008 23:17:18 -0500 (EST) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Sat, 1 Mar 2008 23:17:18 -0500 (EST) From: Greg Smith X-X-Sender: gsmith@westnet.com To: Franck Routier cc: pgsql-performance Subject: Re: 12 disks raid setup In-Reply-To: <1204367277.9116.16.camel@franck-gusty> Message-ID: References: <1204285894.11773.33.camel@franck-gusty> <1204296705.11773.51.camel@franck-gusty> <47C8A6D9.1050502@Sheeky.Biz> <1204367277.9116.16.camel@franck-gusty> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/11 X-Sequence-Number: 28965 On Sat, 1 Mar 2008, Franck Routier wrote: > Well, am I just wrong, or the file system might also heavily rely on > cache, especially as I use XFS ? So anyway Postgresql has no way to know > if the data is really on the disk, and in case of a brutal outage, the > system may definitely lose data, wether there is another level of > caching (Raid controller) or not... After PostgreSQL writes to the WAL, it calls fsync. If your filesystem doesn't then force a real write to disk at that point and clear whatever cache it might have, it's broken and unsuitable for database use. XFS is smart enough to understand that. The only thing people typically run into that will hear fsync and lie about the data actually being written to disk are a) caching controllers with the write cache turned on and b) cheap hard drives. In case (a), having a battery backup for the cache is sufficient to survive most classes of outage without damage--if the system is without power for longer than the battery lasts you're in trouble, otherwise is shouldn't be a problem. In case (b), you have to turn the disk cache off to get reliable database operation. I've put all the interesting trivia on this topic I've ever come across at http://www.westnet.com/~gsmith/content/postgresql/TuningPGWAL.htm if you're looking for some really exciting reading. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD