I have created a RAID10 array (near layout) with four 8 GiB virtual hard drives, making a 16 GiB array (/dev/md0 formatted as ext4). On the other hand, I have a 16 GiB RAID1 array (/dev/md1, also formatted as ext4).
The purpose of these setups is to compare the read and write performances of each array.
So far, I have used dd to perform the following tests:
dd (sequential write performance):
dd if=/dev/zero of=/dev/md0 count=512 bs=1024k
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 6.60623 s, 81.3 MB/s
dd if=/dev/zero of=/dev/md1 count=512 bs=1024k
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 5.74421 s, 93.5 MB/s
dd (sequential read performance):
dd if=/dev/md0 of=/dev/null bs=4096k
4093+1 records in
4093+1 records out
17168334848 bytes (17 GB) copied, 168.665 s, 102 MB/s
dd if=/dev/md1 of=/dev/null bs=4096k
4093+1 records in
4093+1 records out
17170300928 bytes (17 GB) copied, 44.6421 s, 385 MB/s
So I changed the RAID10 array layout to f2, and sequential read performance improved but the write performance decreased compared to n2 (which was the previous layout):
dd if=/dev/md0 of=/dev/null bs=4096k
4093+0 records in
4093+0 records out
17167286272 bytes (17 GB) copied, 110.424 s, 155 MB/s
dd if=/dev/zero of=/dev/md0 count=512 bs=1024k
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 6.84386 s, 78.4 MB/s
I was expecting that the RAID10 array would have a better read performance that that of RAID1, but it isn't the case as per these tests - even when I have performed them several times to avoid outliers. I have also used iozone for benchmarking the same setups, with similar results.
I am also aware that other factors may impact performance, such as the hardware used (perhaps virtual hard drives may not provide the best scenario?) and the filesystem.
That being said, what would be the best setup for a RAID10 array that will undergo more reads than writes? (In addition, I am looking for further reasons to use RAID10 instead of RAID1 other than the fault tolerance provided by the latter).
Any tips and ideas will be more than welcome.
Thanks in advance.