0

I'm testing some RAID setups built with mdadm. This is about parallel reads on a 2-disks array.

RAID1 seems to balance the reads by process, some sort of coarse-grained balancing, so reading the whole raid array with a simple dd if=/dev/md0 of=/dev/null bs=1M, according to nmon, basically directs all the read to /dev/sda. When multiple dd commands run in parallel, some read from sda some from sdb.

Curiously, I tested with RAID5, same two disks, same redundancy and 50% disk utilization. One single low-level read with dd is spread across sda and sdb evenly, so every read operation seems to be better parallelized.

Effects on the CPU load seem to be negligible. I also haven't checked write operations.

Does using RAID5 for a 2-disks array make any sense?

By the way, going back and forth between 1 and 5 is as easy as mdadm --grow /dev/md0 --level 1 or 5, no data is moved, only the parallel read pattern changes.

1

One single low-level read with dd is spread across sda and sdb evenly, so every read operation seems to be better parallelized.

You're misreading what's going on in RAID-5. To read any data from a RAID-5 array, all disks have to be read from, and the actual data extracted from the "data + parity" that's stored on all the disks in the array.

In reality, you have to read twice as much data in the RAID-5 configuration to get your data, but with the added benefit of detecting data corruption. (To the extent RAID-5 protects against data corruption. It's not complete.)

In a RAID-1 mirror, you'll only detect data corruption in a full scrub of the array.

Does using RAID5 for a 2-disks array make any sense?

If you want data corruption detection, yes. But remember that comes at the cost of needing twice the read bandwidth and twice the number of read IO operations.

0

Does using RAID5 for a 2-disks array make any sense?

No, it needs 3+ disks. You should specify RAID1 when you want a mirror. Do not rely on the implementation details like mdadm doing a sane thing and being effectively RAID1 for 2 disk array.

Also, don't use RAID5, a second failure on rebuild is likely. Two disks in RAID 1, or 4+ in RAID6 or RAID10.

  • RAID5 is making a comeback with the advent of commodity SSDs. Major vendors (HPE come to mind) are not exactly pushing RAID5 on SSD arrays but they're putting it on part with RAID6. – doneal24 Feb 15 at 15:34
  • Just because you can configure single parity does not mean it is a good idea, those use cases are the exception. Dual- or triple-parity is the only option on several arrays, including the HPE-owned Nimble. – John Mahowald Feb 15 at 16:41
  • The rebuild time on a SSD is much faster than on spinning disk and the failure rate is much lower. Since rebuild time and failure rate are generally the reasons given for preferring RAID6 over RAID5, the argument really doesn't apply here. When Nimble was acquired by HPE, the majority of their portfolio was on spinning disk so they had to enforce RAID6 or erasure-encoding to ensure data protection. Another HPE acquisition, Simplivity, appears to use RAID5 by default on its installs, which is always on all-flash arrays. – doneal24 Feb 15 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.