Software RAID issues (was Re: Suggestions solicited, server bring up)
Ben Scott
dragonhawk at gmail.com
Sat Nov 21 18:00:20 EST 2009
On Sat, Nov 21, 2009 at 11:40 AM, Bruce Labitt
<bruce.labitt at myfairpoint.net> wrote:
> Bill, why not RAID-5? Isn't RAID-5 supposed to be ultra-reliable?
RAID 5 is not more reliable than RAID 1. Both can survive the
failure of a single physical disk; both will fail if two disks fail.
Mirror (RAID 1) is simple enough: Each logical block in the RAID
volume gets written to two identical physical disks. Effective
capacity is one disk. Either disk can be read. Read performance can
be twice a single disk (since you can interleave reads between two
physical disks). Write performance will at best be no worse than a
single disk, but in practice is often worse, because the hardware only
has one I/O channel to the disk.
RAID 5 is a stripe set with parity. You need at least three disks;
all disks are identical. Effective capacity = (number of disks minus
one) times (size of each disk). In theory, read performance can be
faster than a single disk, because you're spreading the I/O across
multiple disks. In practice, limited I/O channels (can only
read/write one disk at a time) usually mean reads aren't faster.
Writes are usually slower. This is due to the need to generate parity
on writes. Most RAID implementations work on groups of blocks (called
"stripes"). The OS writes a block. The RAID has to read multiple
stripes, change that one block, recalculate the parity for all the
stripes, and then write the changed stripes back out again. A
controller can compensate for this with parallel I/O, a fast ASIC (to
do vector XOR in hardware), and lots of cache, but such controllers
are expensive and usually still have trouble keeping up with a single
disk.
RAID 5 made more sense back when disks are smaller. With single
disks well over a terabyte these days, the scenarios where RAID 5
makes sense are few. Most of the time, most people's data will fit on
a single mirror. If you really do need more than 2 TB or so you can
fit on a mirror, chances are you need more performance than RAID 5 can
give you. A stripe set of mirrors ("RAID 10") is typically preferred.
Rebuild time is also a concern. If your mirror (RAID 1) fails, you
replace the failed disk, and copy the good disk to the new disk. If a
RAID 5 disk fails, you have to re-read every remaining disk to
regenerate the failed disk. Especially on a cheap controller, this is
*SLOW*.
> As in hot swap disks?
Hot swap is a property of the disk controller, not the RAID level.
You can do software RAID 5 on a system that doesn't support hot swap.
A lot of modern SATA hardware support hot swap even without RAID.
-- Ben
More information about the gnhlug-discuss
mailing list