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

Written by Gionatan Danti on . Posted in Linux & Unix

User Rating:  / 31
PoorBest 

Conclusions

OK, let's summarize:

  • “near” layout is a very reasonable default, as it give very good random I/O and passable sequential speed;
  • “offset” layout is my favorite: it had good random I/O and good sequential speed, showing the better of the two worlds;
  • “far” layout has very high sequential speed, but its lower random I/O performance means that, unless you are sure that your workload is mainly composed of sequential operations, you should avoid it.

Remember that the above tests were done on a 100 GiB disk partition (~200 GiB useful array size). This means that, will full disk partitions, “far” random I/O results can be significantly lower then expected.

Please also note that, while IOMeter is a wonderful tool, it had its limitation. Moreover, no synthetical test can cover 100% of real-world scenarios so it would be preferable to do some quick testing of your specific needs. In my case, as I will use this array to host virtual machine files, I found IOMeter to accurately represent my usage pattern (low metadata overhead, many read/write operations on one or few files, etc.) and so I happily used it ;)

 

I hope that you find this article interesting. If you want, you can discuss it with me using the comment system or by writing at This email address is being protected from spambots. You need JavaScript enabled to view it.

Have a nice day!

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