Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 5EA5A9FB317 for ; Tue, 27 Feb 2007 01:07:33 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 05765-05 for ; Tue, 27 Feb 2007 01:07:10 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by postgresql.org (Postfix) with ESMTP id 847589FB6BE for ; Tue, 27 Feb 2007 01:07:09 -0400 (AST) Received: from ppp247-71.static.internode.on.net (HELO [192.168.8.200]) ([203.122.247.71]) by ipmail02.adl2.internode.on.net with ESMTP; 27 Feb 2007 15:35:18 +1030 X-IronPort-AV: i="4.14,223,1170595800"; d="scan'208"; a="90407848:sNHT4262938729" Message-ID: <45E3BC09.60100@Sheeky.Biz> Date: Tue, 27 Feb 2007 15:35:13 +1030 From: Shane Ambler User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025) MIME-Version: 1.0 To: Jeff Davis CC: Peter Kovacs , Tom Lane , Carlos Moreno , pgsql-performance@postgresql.org Subject: Re: Two hard drives --- what to do with them? References: <45DF3B15.1070609@3times25.net> <45DF5DA9.90002@commandprompt.com> <45DF6154.5090205@3times25.net> <1d4e0c10702231425ke37a732y36e241902fe0aa55@mail.gmail.com> <45DF94BF.6050904@3times25.net> <45E0A500.1010707@commandprompt.com> <45E104DD.3080600@mochima.com> <2055.1172375931@sss.pgh.pa.us> <1172526666.10824.315.camel@dogma.v10.wvs> <1172535914.10824.327.camel@dogma.v10.wvs> In-Reply-To: <1172535914.10824.327.camel@dogma.v10.wvs> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.97 tagged_above=0 required=5 tests=AWL, BAYES_40, BIZ_TLD, SPF_HELO_PASS X-Spam-Level: * X-Archive-Number: 200702/316 X-Sequence-Number: 23370 Jeff Davis wrote: >> Sorry for for not being familar with storage techonologies... Does >> "battery" here mean battery in the common sense of the word - some >> kind of independent power supply? Shouldn't the disk itself be backed >> by a battery? As should the entire storage subsystem? >> > > Yes, a battery that can hold power to keep data alive in the write cache > in case of power failure, etc., for a long enough time to recover and > commit the data to disk. Just to expand a bit - the battery backup options are available on some raid cards - that is where you would be looking for it. I don't know of any hard drives that have it built in. Of cause another reason to have a UPS for the server - keep it running long enough after the clients have gone down so that it can ensure everything is on disk and shuts down properly. > So, a write cache is OK (even for pg_xlog) if it is durable (i.e. on > permanent storage or backed by enough power to make sure it gets there). > However, if PostgreSQL has no way to know whether a write is durable or > not, it can't guarantee the data is safe. > > The reason this becomes an issue is that many consumer-grade disks have > write cache enabled by default and no way to make sure the cached data > actually gets written. So, essentially, these disks "lie" and say they > wrote the data, when in reality, it's in volatile memory. It's > recommended that you disable write cache on such a device. From all that I have heard this is another advantage of SCSI disks - they honor these settings as you would expect - many IDE/SATA disks often say "sure I'll disable the cache" but continue to use it or don't retain the setting after restart. -- Shane Ambler pgSQL@Sheeky.Biz Get Sheeky @ http://Sheeky.Biz