Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 78E8E9FB4D2 for ; Tue, 27 Feb 2007 04:28:02 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 45675-04 for ; Tue, 27 Feb 2007 04:27:59 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by postgresql.org (Postfix) with ESMTP id DFCD09FB4BE for ; Tue, 27 Feb 2007 04:27:58 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so894805ugf for ; Tue, 27 Feb 2007 00:27:57 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=QZBLnKHAYiIdOAyBW0aEJHIx0gBW8JgmgWhNQ75P6PeWHEQCA89zwiNqPYQ1f6BercArog3lSF8ybj5Z4/5Vryc7CZt732EsBY3emMBzG6fF9li0DgzyKMnJ8Jca2+lcJ5ZRn1KuEXOSu4+ErSlvsj+UdTJtBQorV/wGcO+luPM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=HzuBfn7sxQnKM3xSP01mgdyPqswevpqnO3zEycelzVIiAdmNbrqo03SBQGUhfanjwAJI5qqEUlS6pe6rha481Kgxr6fca+VCkptXLglftotTt1G/1yeMVWIPpdXStbnOdVgfOTIfIkLPRkV7O6Qxw8vDNcLr9Z/WcGU5Fk88HaA= Received: by 10.114.151.13 with SMTP id y13mr2475956wad.1172564872353; Tue, 27 Feb 2007 00:27:52 -0800 (PST) Received: by 10.114.154.16 with HTTP; Tue, 27 Feb 2007 00:27:52 -0800 (PST) Message-ID: Date: Tue, 27 Feb 2007 09:27:52 +0100 From: "Peter Kovacs" To: "Shane Ambler" Subject: Re: Two hard drives --- what to do with them? Cc: "Jeff Davis" , "Tom Lane" , "Carlos Moreno" , pgsql-performance@postgresql.org In-Reply-To: <45E3BC09.60100@Sheeky.Biz> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45DF3B15.1070609@3times25.net> <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> <45E3BC09.60100@Sheeky.Biz> X-Google-Sender-Auth: 6272cf79ae68d243 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/317 X-Sequence-Number: 23371 On 2/27/07, Shane Ambler wrote: > 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. As far as I know, SCSI drives also have "write cache" which is turned off by default, but can be turned on (e.g. with the sdparm utility on Linux). The reason I am so much interested in how write cache is typically used (on or off) is that I recently ran our benchmarks on a machine with SCSI disks and those benchmarks with high commit ratio suffered significantly compared to our previous results "traditionally" obtained on machines with IDE drives. I wonder if running a machine on a UPS + 1 hot standby internal PS is equivalent, in terms of data integrity, to using battery backed write cache. Instinctively, I'd think that UPS + 1 hot standby internal PS is better, since this setup also provides for the disk to actually write out the content of the cache -- as you pointed out. Thanks Peter > > > -- > > Shane Ambler > pgSQL@Sheeky.Biz > > Get Sheeky @ http://Sheeky.Biz >