Gentoo Archives: gentoo-user

From: Kerin Millar <kerframil@×××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] RAID 1 vs RAID 0 - Read perfonmance
Date: Mon, 24 Feb 2014 07:24:27
Message-Id: 530AF39F.2080101@fastmail.co.uk
In Reply to: [gentoo-user] RAID 1 vs RAID 0 - Read perfonmance by Facundo Curti
1 On 24/02/2014 06:27, Facundo Curti wrote:
2 > Hi. I am again, with a similar question to previous.
3 >
4 > I want to install RAID on SSD's.
5 >
6 > Comparing THEORETICALLY, RAID0 (stripe) vs RAID1 (mirrior). The
7 > performance would be something like this:
8 >
9 > n= number of disks
10 >
11 > reads:
12 > raid1: n*2
13 > raid0: n*2
14 >
15 > writes:
16 > raid1: n
17 > raid0: n*2
18 >
19 > But, in real life, the reads from raid 0 doesn't work at all, because if
20 > you use "chunk size" from 4k, and you need to read just 2kb (most binary
21 > files, txt files, etc..). the read speed should be just of n.
22
23 While the workload does matter, that's not really how it works. Be aware
24 that Linux implements read-ahead (defaulting to 128K):-
25
26 # blockdev --getra /dev/sda
27 256
28
29 That's enough to populate 32 pages in pagecache, given that PAGESIZE is
30 4K on i386/am64.
31
32 >
33 > On the other side, I read over the net, that kernel don't support
34 > multithread reads on raid1. So, the read speed will be just n. Always.
35 > ¿It is true?
36
37 No, it is not true. Read balancing is implemented in RAID-1.
38
39 >
40 > Anyway, my question is. ¿Who have the best read speed for the day to
41 > day? I'm not asking about reads off large files. I'm just asking in the
42 > "normal" use. Opening firefox, X, regular files, etc..
43
44 For casual usage, it shouldn't make any difference.
45
46 >
47 > I can't find the guide definitive. It allways are talking about
48 > theoretically performance, or about "real life" but without benchmarks
49 > or reliable data.
50 >
51 > Having a RAID0 with SSD, and following [2] on "SSD Stripe Optimization"
52 > should I have the same speed as an RAID1?
53
54 I would highly recommend conducting your own benchmarks. I find sysbench
55 to be particularly useful.
56
57
58 >
59 > My question is because i'm between. 4 disks raid1, or RAID10 (I want
60 > redundancy anyway..). And as "raid 10" = 1+ 0. I need to know raid0
61 > performance to take a choice... I don't need write speed, just read.
62
63 In Linux, RAID-10 is not really nested because the mirroring and
64 striping is fully integrated. If you want the best read performance with
65 RAID-10 then the "far" layout is supposed to be the best [1].
66
67 Here is an example of how to choose this layout:
68
69 # mdadm -C /dev/md0 -n 4 -l 10 -p f2 /dev/sda /dev/sdb /dev/sdc /dev/sdd
70
71 Note, however, that the far layout will exhibit worse performance than
72 the "near" layout if the array is in a degraded state. Also, it
73 increases seek time in random/mixed workloads but this should not matter
74 if you are using SSDs.
75
76 --Kerin
77
78 [1] http://neil.brown.name/blog/20040827225440