Skip site navigation (1) Skip section navigation (2)

Re: performance on new linux box

From: Ben Chobot <bench(at)silentmedia(dot)com>
To: Ryan Wexler <ryan(at)iridiumsuite(dot)com>
Cc: PostgreSQL - Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: performance on new linux box
Date: 2010-07-15 22:18:45
Message-ID: A6461AB5-0812-4C86-9BF4-3C0EA36148A7@silentmedia.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Jul 15, 2010, at 2:40 PM, Ryan Wexler wrote:

> On Thu, Jul 15, 2010 at 12:35 PM, Ben Chobot <bench(at)silentmedia(dot)com> wrote:
> On Jul 15, 2010, at 9:30 AM, Scott Carey wrote:
> 
> >> 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.
> > Write caching on all hard drives in the last decade are safe because they support a write cache flush command properly.  If the card is "smart" it would issue the drive's write cache flush command to fulfill an fsync() or barrier request with no BBU.
> 
> You're missing the point. If the power dies suddenly, there's no time to flush any cache anywhere. That's the entire point of the BBU - it keeps the RAM powered up on the raid card. It doesn't keep the disks spinning long enough to flush caches.
> --
> Sent via pgsql-performance mailing list (pgsql-performance(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
> 
> So you are saying write caching is a dangerous proposition on a raid card with or without BBU?


Er, no, sorry, I am not being very clear it seems. 


Using a cache for write caching is dangerous, unless you protect it with a battery. Caches on a raid card can be protected by a BBU, so, when you use a BBU, write caching on the raid card is safe. (Just don't read the firmware changelog for your raid card or you will always be paranoid.) If you don't have a BBU, many raid cards default to disabling caching. You can still enable it, but the card will often tell you it's a bad idea.

There are also caches on all your disk drives. Write caching there is always dangerous, which is why almost all raid cards always disable the hard drive write caching, with or without a BBU. I'm not even sure how many raid cards let you enable the write cache on a drive... hopefully, not many.

In response to

Responses

pgsql-performance by date

Next:From: Pierre CDate: 2010-07-15 22:46:54
Subject: Re: Question of using COPY on a table with triggers
Previous:From: Ryan WexlerDate: 2010-07-15 21:40:20
Subject: Re: performance on new linux box

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group