Re: Raid 5 vs Raid 10 Benchmarks Using bonnie++

From: david(at)lang(dot)hm
To: Aidan Van Dyk <aidan(at)highrise(dot)ca>
Cc: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>, Ogden <lists(at)darkstatic(dot)com>, pgsql-performance(at)postgresql(dot)org, Greg Smith <greg(at)2ndquadrant(dot)com>
Subject: Re: Raid 5 vs Raid 10 Benchmarks Using bonnie++
Date: 2011-09-12 22:57:48
Message-ID: alpine.DEB.2.02.1109121555040.522@asgard.lang.hm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

apologies for such a late response to this thread, but there is domething
I think is _really_ dangerous here.

On Thu, 18 Aug 2011, Aidan Van Dyk wrote:

> On Thu, Aug 18, 2011 at 1:35 AM, Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> wrote:
>> On 18/08/2011 11:48 AM, Ogden wrote:
>>>
>>> Isn't this very dangerous? I have the Dell PERC H700 card - I see that it
>>> has 512Mb Cache. Is this the same thing and good enough to switch to
>>> nobarrier? Just worried if a sudden power shut down, then data can be lost
>>> on this option.
>>>
>>>
>> Yeah, I'm confused by that too. Shouldn't a write barrier flush data to
>> persistent storage - in this case, the RAID card's battery backed cache? Why
>> would it force a RAID controller cache flush to disk, too?
>
> The "barrier" is the linux fs/block way of saying "these writes need
> to be on persistent media before I can depend on them". On typical
> spinning media disks, that means out of the disk cache (which is not
> persistent) and on platters. The way it assures that the writes are
> on "persistant media" is with a "flush cache" type of command. The
> "flush cache" is a close approximation to "make sure it's persistent".
>
> If your cache is battery backed, it is now persistent, and there is no
> need to "flush cache", hence the nobarrier option if you believe your
> cache is persistent.
>
> Now, make sure that even though your raid cache is persistent, your
> disks have cache in write-through mode, cause it would suck for your
> raid cache to "work", but believe the data is safely on disk and only
> find out that it was in the disks (small) cache, and you're raid is
> out of sync after an outage because of that... I believe most raid
> cards will handle that correctly for you automatically.

if you don't have barriers enabled, the data may not get written out of
main memory to the battery backed memory on the card as the OS has no
reason to do the write out of the OS buffers now rather than later.

Every raid card I have seen has ignored the 'flush cache' type of command
if it has a battery and that battery is good, so you leave the barriers
enabled and the card still gives you great performance.

David Lang

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Marinos Yannikos 2011-09-12 23:11:12 Re: Sudden drop in DBb performance
Previous Message Robert Schnabel 2011-09-12 22:21:58 Re: Allow sorts to use more available memory