Linux software RAID 10 layouts performance: near, far and offset benchmark analysis

Written by Gionatan Danti on . Posted in Linux & Unix

User Rating:  / 29
PoorBest 

In common scenarios, storage subsystem speed represents a significant performance bottleneck: classical electromechanical disks are very good at areal density and sequential read/write speed, but they are terribly slow at random and/or mixed read/write operations. Moreover, being  electromechanical devices, normal hard-disks are quite prone to failures and malfunctions.

While SSD (and even more expensive RAM-DRIVE) significantly addresses this problem, the reality is that platter-based disks are currently the dominant storage media, and this situation will hardly change in the following 3-5 years.

In order to increase performances and reliability, many servers/workstations/NAS combine, in differnt fashion, multiple disks into single logical drives. This multi-disk-for-a-volume schema is called RAID – Redundant array of independent (or inexpensive) disks. You can read more on the subject here and here.

Sometime RAID volumes are managed by an application-specific card/circuit, the so called “hardware RAID controller”. Other times, RAID arrays are managed by a software driver inside the operating system, creating a “software RAID” volume. Linux has an advanced software-RAID layer that not only supports different RAID level (eg: RAID 0, RAID 1, etc.), but has quite good performance.

This article will focus on a specific RAID level: the RAID 10 (or 1+0) configuration. We will dive into configuration details and benchmarks of this speedy and reliable RAID setup.

Comments   

 
#11 Eli Vaughan 2014-03-19 17:05
Without getting into the holy war of near/far/offset performance/rel iability...

You responded to someone that the option for creating said arrays used the "-p [layout]" option. however, i wanted to point out that (with a performance hit) you can use different options than simply near, far, offset. you can store multiple copies of the mirror (more then 2 mirrors) by simply specifying. this will help redundancy, at an obvious hit on performance.

--layout=n3 3 near copies
--layout=f3 3 far copies
--layout=o3 3 offset copies

Just a note. Great write up.
 
 
#12 Rüdiger Meier 2017-02-28 12:51
I wonder why you write for "near layout
"2x sequential read speed (sequential read access can be striped only over disks with different data)

Shouldn't it be possible to read blocks A,B,C,D also from 4 different disks?

I guess the far-layout advantage for sequential reads is because rotating disks are usually faster at the beginning of the disk. So when reading far-layout it's possible to only use the first half of each disk.

And here is maybe one disadvantage of far-layout: I guess it's not possible to make all disks larger (or smaller) to enlarge (or shrink) the array space without rebuilding the whole array. This should be no problem for near and offset.
 
 
#13 Gionatan Danti 2017-02-28 16:37
Quoting Rüdiger Meier:

Shouldn't it be possible to read blocks A,B,C,D also from 4 different disks?


Basically, the answer is NO, for two reasons:

1) the kernel md driver can dispatch a single, large read request to chunked/striped disks only. This means that the "mirror" drives (in a RAID10 setup) are not engaged by single sequential read requests. I just recently tested a 4-way RAID1 mirror and, while multiple concurrent random read requests scaled very well (4x the single drive result), single sequential read requests were no faster than single drive.

2) even if the kernel splits a single large request and dispatch its chunks to different mirrored drives (and it does NOT that), you had to consider that, due to how data are physically layed out on the disk platter, scaling would be much less than ideal. For example, lets consider how data on the first disks pair of a RAID10 "near" layout are placed:

DISK1: A B C D E F G H
DISK2: A B C D E F G H

If a request requires both A and B chunks, it can theoretically engage both disks (and I repeat: with current kernels this does NOT happen), with a corresponding increasing in throughput. However, if a subsequent request require C and D chunks, you had to consider that DISK1's heads MUST travel over the (redundant) B chunks, wasting potential bandwidth.

In short: while RAID1 near layout is very good for random reads, it fall short of offset/far for sequential reads. Anyway, random reads often are the most frequent access pattern, rather than large sequential IO.

Regards.
 

You have no rights to post comments