Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 906B1632668 for ; Thu, 8 Jul 2010 18:42:23 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 13195-09 for ; Thu, 8 Jul 2010 21:42:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gw0-f46.google.com (mail-gw0-f46.google.com [74.125.83.46]) by mail.postgresql.org (Postfix) with ESMTP id 4BF566324F6 for ; Thu, 8 Jul 2010 18:42:11 -0300 (ADT) Received: by gwj18 with SMTP id 18so318388gwj.19 for ; Thu, 08 Jul 2010 14:42:10 -0700 (PDT) Received: by 10.229.219.148 with SMTP id hu20mr5338246qcb.162.1278625329741; Thu, 08 Jul 2010 14:42:09 -0700 (PDT) Received: from Craig-Jamess-MacBook-Pro.local (wsip-70-167-124-126.sd.sd.cox.net [70.167.124.126]) by mx.google.com with ESMTPS id g33sm527013qcq.28.2010.07.08.14.42.07 (version=SSLv3 cipher=RC4-MD5); Thu, 08 Jul 2010 14:42:09 -0700 (PDT) Message-ID: <4C36462E.1080405@emolecules.com> Date: Thu, 08 Jul 2010 14:42:06 -0700 From: Craig James User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: Timothy.Noonan@emc.com CC: pgsql-performance@postgresql.org Subject: Re: performance on new linux box References: <4C3532CC.6070601@squeakycode.net> <4C3591F40200002500033219@gw.wicourts.gov> <4C35A23B0200002500033220@gw.wicourts.gov> <4C360677.1090608@emolecules.com> <95971335.20100708211351@erwied.eu> <488953776.20100708213233@erwied.eu> <4C35E4CA020000250003327E@gw.wicourts.gov> <4C363CAE.7010401@emolecules.com> In-Reply-To: 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.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201007/139 X-Sequence-Number: 39528 On 7/8/10 2:18 PM, Timothy.Noonan@emc.com wrote: > How does the linux machine know that there is a BBU installed and to > change its behavior or change the behavior of Postgres? I am > experiencing performance issues, not with searching but more with IO. It doesn't. It trusts the disk controller. Linux says, "Flush your cache" and the controller says, "OK, it's flushed." In the case of a BBU controller, the controller can say that almost instantly because it's got the data in a battery-backed memory that will survive even if the power goes out. In the case of a non-BBU controller (RAID or non-RAID), the controller has to actually wait for the head to move to the right spot, then wait for the disk to spin around to the right sector, then write the data. Only then can it say, "OK, it's flushed." So to Linux, it just appears to be a disk that's exceptionally fast at flushing its buffers. Craig > > -----Original Message----- > From: pgsql-performance-owner@postgresql.org > [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Craig James > Sent: Thursday, July 08, 2010 4:02 PM > To: pgsql-performance@postgresql.org > Subject: Re: [PERFORM] performance on new linux box > > On 7/8/10 12:47 PM, Ryan Wexler wrote: >> >> >> On Thu, Jul 8, 2010 at 12:46 PM, Kevin Grittner >> > > wrote: >> >> Ryan Wexler> >> wrote: >> >> > One thing I don't understand is why BBU will result in a huge >> > performance gain. I thought BBU was all about power failures? >> >> Well, it makes it safe for the controller to consider the write >> complete as soon as it hits the RAM cache, rather than waiting for >> persistence to the disk itself. It can then schedule the writes > in >> a manner which is efficient based on the physical medium. >> >> Something like this was probably happening on your non-server >> machines, but without BBU it was not actually safe. Server class >> machines tend to be more conservative about not losing your data, >> but without a RAID controller with BBU cache, that slows writes > down >> to the speed of the rotating disks. >> >> -Kevin >> >> Thanks for the explanations that makes things clearer. It still > amazes >> me that it would account for a 5x change in IO. > > It's not exactly a 5x change in I/O, rather it's a 5x change in > *transactions*. Without a BBU Postgres has to wait for each transaction > to by physically written to the disk, which at 7200 RPM (or 10K or 15K) > means a few hundred per second. Most of the time Postgres is just > sitting there waiting for the disk to say, "OK, I did it." With BBU, > once the RAID card has the data, it's virtually guaranteed it will get > to the disk even if the power fails, so the RAID controller says, "OK, I > did it" even though the data is still in the controller's cache and not > actually on the disk. > > It means there's no tight relationship between the disk's rotational > speed and your transaction rate. > > Craig >