Motherboard query...

Jakob Østergaard jakob at unthought.net
Fri Mar 1 00:34:59 PST 2002


On Thu, Feb 28, 2002 at 06:52:42PM -0800, Trent Piepho wrote:
> On Thu, 28 Feb 2002, Mark Hahn wrote:
> > > Raid 5 is costly. As I understand it (not very well) there's 3 writes for
> > > RAID 5. Reading can be slow, but not nearly as bad. Obviously you dont want
> > 
> > I've never quite understood why people think R5 is expensive.
> > yes, you have to do the parity calculation, and a 1 byte write
> > does require an update of the parity block for that stripe,
> > but it's not egregious.
> 
> In order to update a single RAID5 block you need to do two reads and two
> writes.

Wrong.

If you're writing not just one-bit-here-and-one-bit-there, but streaming
megabytes to the disk - then the buffer cache will already hold the information
needed for parity calculation (because userspace just told the kernel to write
it to the disks anyway).  Thus, to write a full stripe including parity on an N
disk RAID-5 - you need *zero* reads, and N writes (one per disk) and they
parallelize and "pipeline" perfectly.

Of course this is slower than RAID-0 (because it *is* not as simple - there are
more lines of code - and the XOR being fast, still isn't free) - but it does
not have to be a lot slower.

>  The two reads are the block to be written and the parity block.  You
> need to XOR the old data block ^ old parity block ^ new data block, to get the
> new parity block.  Then write the new parity and the new data.  Much slower!

Yep - for a naive implementation.  There are many performance tricks that can
be pulled, and Linux currently pulls some of them.  Being smart about reads on
RAID-5 is one of them.

> For instance, the 3ware 7410 card we get something like 75Mb/sec writes to 4
> drives in raid 0 and 5.6MB/sec in raid 5.

Well, luckily one *implementation* with poor performance doesn't prove that efficient
implementations are impossible   :)

('implementation' here meaning both software and hardware)

 Cheers,

-- 
................................................................
:   jakob at unthought.net   : And I see the elder races,         :
:.........................: putrid forms of man                :
:   Jakob Østergaard      : See him rise and claim the earth,  :
:        OZ9ABN           : his downfall is at hand.           :
:.........................:............{Konkhra}...............:



More information about the Beowulf mailing list