Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 9D159632E8E for ; Fri, 16 Jul 2010 08:36:28 -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 71167-07 for ; Fri, 16 Jul 2010 11:36:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [202.4.227.11]) by mail.postgresql.org (Postfix) with ESMTP id E211E632E59 for ; Fri, 16 Jul 2010 08:36:20 -0300 (ADT) Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by www.postnewspapers.com.au (Postfix) with ESMTP id E31789F69; Fri, 16 Jul 2010 19:36:15 +0800 (WST) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id D448AAE851; Fri, 16 Jul 2010 19:33:56 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (mail.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Fg3pq32WyjjT; Fri, 16 Jul 2010 19:33:50 +0800 (WST) Received: from [10.1.1.6] (124-168-255-56.dyn.iinet.net.au [124.168.255.56]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 8258BAE84A; Fri, 16 Jul 2010 19:33:50 +0800 (WST) Message-ID: <4C40442A.4030806@postnewspapers.com.au> Date: Fri, 16 Jul 2010 19:36:10 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: Scott Marlowe CC: "pgsql-performance@postgresql.org" 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> <0BC62364-BD19-41E0-A483-677474CD5A5D@richrelevance.com> In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.51 tagged_above=-10 required=5 tests=BAYES_05=-0.5, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/260 X-Sequence-Number: 39649 On 16/07/10 09:22, Scott Marlowe wrote: > On Thu, Jul 15, 2010 at 10:30 AM, Scott Carey wrote: >> >> On Jul 14, 2010, at 7:50 PM, Ben Chobot wrote: >> >>> On Jul 14, 2010, at 6:57 PM, Scott Carey wrote: >>> >>>> But none of this explains why a 4-disk raid 10 is slower than a 1 disk system. If there is no write-back caching on the RAID, it should still be similar to the one disk setup. >>> >>> Many raid controllers are smart enough to always turn off write caching on the drives, and also disable the feature on their own buffer without a BBU. Add a BBU, and the cache on the controller starts getting used, but *not* the cache on the drives. >> >> This does not make sense. > > Basically, you can have cheap, fast and dangerous (drive with write > cache enabled, which responds positively to fsync even when it hasn't > actually fsynced the data. You can have cheap, slow and safe with a > drive that has a cache but since it'll be fsyncing it all the the time > the write cache won't actually get used, or fast, expensive, and safe, > which is what a BBU RAID card gets by saying the data is fsynced when > it's actually just in cache, but a safe cache that won't get lost on > power down. Speaking of BBUs... do you ever find yourself wishing you could use software RAID with battery backup? I tend to use software RAID quite heavily on non-database servers, as it's cheap, fast, portable from machine to machine, and (in the case of Linux 'md' raid) reliable. Alas, I can't really use it for DB servers due to the need for write-back caching. There's no technical reason I know of why sw raid couldn't write-cache to some non-volatile memory on the host. A dedicated a battery-backed pair of DIMMS on a PCI-E card mapped into memory would be ideal. Failing that, a PCI-E card with onboard RAM+BATT or fast flash that presents an AHCI interface so it can be used as a virtual HDD would do pretty well. Even one of those SATA "RAM Drive" units would do the job, though forcing everything though the SATA2 bus would be a performance downside. The only issue I see with sw raid write caching is that it probably couldn't be done safely on the root file system. The OS would have to come up, init software raid, and find the caches before it'd be safe to read or write volumes with s/w raid write caching enabled. It's not the sort of thing that'd be practical to implement in GRUB's raid support. -- Craig Ringer