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

Written by Gionatan Danti on . Posted in Linux & Unix

User Rating:  / 31

Random read/write speed

While traditional, rotating disks are quite OK at sequential operations, random I/O is a very different beast: not considering caches and I/O coalescing, a disk with a 10 ms access time will at most complete 100 read/write operations per second. At ~4KiB per operation, this add up at only 400 KiB/sec.

Sure caching and other techniques can improve this rating, but the reality is that platter-based disks remain slow at random operation (for example, a good SSD can be 20x faster then the fastest mechanical disk).

This, coupled with the fact that most server workloads are random in nature, means that a good RAID had to give back a reasonable speedup over single-disk operations, otherwise it will be not so useful.

Let's start with read speed: 

RAID10 Random read speed

All layouts provide very similar results here, but the “near” layout is the leader.

Write speed: 

RAID10 Random write speed

“Near” and “offset” layouts are on par, while “far” is a bit behind. However, it is somewhat surprising  to see that “far” layout is not so slow: given the additional seeks it imposes, I expected it to be even slower. Anyway, we had to remember that I am testing with 100 GiB partitions: this means that when using the full disk space (~900 GiB), it can be noticeably slower (as the disk heads need to travel additional distance for each seek).

Last, mixed (50% read – 50% write) speed: 

RAID10 Random mixed (read/write) speed

Here we see the “near” layout on top, closely followed by “offset”. On the other hand, “far” is significantly slower (remember that this can only get worse if we use full disk space).


#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:


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.


You have no rights to post comments