[CentOS] md raid1 - no speed improvement

Sun Mar 23 12:40:34 UTC 2008
Jacques B. <jjrboucher at gmail.com>

On Sun, Mar 23, 2008 at 8:11 AM, Kieran Clancy
<clancy.kieran+centos at gmail.com> wrote:
> Hi,
>
>  I have two 320 GB SATA disks (/dev/sda, /dev/sdb) in a server running
>  CentOS release 5.
>
>  They both have three partitions setup as RAID1 using md (boot, swap,
>  and an LVM data partition).
>
<snip>
>
>  When I do tests though, I find that the md raid1 read performance is
>  no better than either of the two disks on their own
>
<snip>
>
>  Thanks,
>  Kieran Clancy.

As a few already pointed out, RAID 1 is mirroring.  So whatever gets
written to the first drive also gets written to the second drive as
well.  It provides redundancy, not performance.  I've used RAID 5 in
the past to achieve performance with redundancy.  But of course it has
to be stripped across drives and not partitions.  I saw a case where
someone implemented RAID 1 by partitioning the drive into two and
setting up the two partitions as RAID 1.  So drive performance took a
drastic nose dive and redundancy was practically worthless as the
mirror resided on the same drive.

With only two drives, your options are RAID 0 or RAID 1 (see
http://en.wikipedia.org/wiki/RAID#Standard_levels).  RAID 0 will cause
the two drives to be treated as one big drive (or each combination of
partitions to be treated as larger partitions).  The data would be
stripped across the two drives (for each respective partition) which
would give you a performance increase.  However there would be no
fault tolerance.  If something crashed, your data is gone.  And data
recovery on a RAID where the data is stripped across drives is no easy
task vs a standalone drive.  So if redundancy is an important factor
you will want a good backup system in lieu of another RAID level which
offers fault tolerance.

Jacques B.