Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4DD7E63270E for ; Thu, 15 Jul 2010 20:05:39 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 34471-05 for ; Thu, 15 Jul 2010 23:05:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from 27.mail-out.ovh.net (27.mail-out.ovh.net [91.121.30.210]) by mail.postgresql.org (Postfix) with SMTP id C996263267E for ; Thu, 15 Jul 2010 20:05:31 -0300 (ADT) Received: (qmail 8970 invoked by uid 503); 15 Jul 2010 23:07:16 -0000 Received: from b7.ovh.net (HELO mail437.ha.ovh.net) (213.186.33.57) by 27.mail-out.ovh.net with SMTP; 15 Jul 2010 23:07:16 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 16 Jul 2010 01:05:30 +0200 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO apollo13) (lists%peufeu.com@88.161.102.87) by ns0.ovh.net with SMTP; 16 Jul 2010 01:05:28 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Ben Chobot" , "Ryan Wexler" Cc: "PostgreSQL - Performance" Subject: Re: performance on new linux box References: <4C35A23B0200002500033220@gw.wicourts.gov> <4C360677.1090608@emolecules.com> <95971335.20100708211351@erwied.eu> <488953776.20100708213233@erwied.eu> <4C35E4CA020000250003327E@gw.wicourts.gov> <4C363CAE.7010401@emolecules.com> <4C36462E.1080405@emolecules.com> <822 F9CEE-570F-43F7-980F-A721EA7952D1@richrelevance.com> <61C79B98-EDA0-4F5C-B43C-C3387FD1D9C1@silentmedia.com> Date: Fri, 16 Jul 2010 00:57:28 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Pierre C" Message-ID: In-Reply-To: <61C79B98-EDA0-4F5C-B43C-C3387FD1D9C1@silentmedia.com> User-Agent: Opera Mail/10.10 (Linux) X-Ovh-Tracer-Id: 10680286516611122717 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.8 tagged_above=-10 required=5 tests=BAYES_50=0.8, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201007/254 X-Sequence-Number: 39643 > Most (all?) hard drives have cache built into them. Many raid cards have > cache built into them. When the power dies, all the data in any cache is > lost, which is why it's dangerous to use it for write caching. For that > reason, you can attach a BBU to a raid card which keeps the cache alive > until the power is restored (hopefully). But no hard drive I am aware of > lets you attach a battery, so using a hard drive's cache for write > caching will always be dangerous. > > That's why many raid cards will always disable write caching on the hard > drives themselves, and only enable write caching using their own memory > when a BBU is installed. > > Does that make more sense? > Actually write cache is only dangerous if the OS and postgres think some stuff is written to the disk when in fact it is only in the cache and not written yet. When power is lost, cache contents are SUPPOSED to be lost. In a normal situation, postgres and the OS assume nothing is written to the disk (ie, it may be in cache not on disk) until a proper cache flush is issued and responded to by the hardware. That's what xlog and journals are for. If the hardware doesn't lie, and the kernel/FS doesn't have any bugs, no problem. You can't get decent write performance on rotating media without a write cache somewhere...