Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] which linux RAID setup to choose?
Date: Sun, 03 May 2020 22:34:48
Message-Id: CAGfcS_=nD_xMnfiMCkCjP6Ya4=yHp860iFpTEVOzR-GpziE0yQ@mail.gmail.com
In Reply to: Re: [gentoo-user] which linux RAID setup to choose? by antlists
1 On Sun, May 3, 2020 at 5:32 PM antlists <antlists@××××××××××××.uk> wrote:
2 >
3 > On 03/05/2020 21:07, Rich Freeman wrote:
4 > > I don't think you should focus so much on whether read=write in your
5 > > RAID. I'd focus more on whether read and write both meet your
6 > > requirements.
7 >
8 > If you think about it, it's obvious that raid-1 will read faster than it
9 > writes - it has to write two copies while it only reads one.
10
11 Yes. The same is true for RAID10, since it has to also write two
12 copies of everything.
13
14 >
15 > Likewise, raids 5 and 6 will be slower writing than reading - for a
16 > normal read it only reads the data disks, but when writing it has to
17 > write (and calculate!) parity as well.
18
19 Yes, but with any of the striped modes (0, 5, 6, 10) there is an
20 additional issue. Writes have to generally be made in entire stripes,
21 so if you overwrite data in-place in units smaller than an entire
22 stripe, then the entire stripe needs to first be read, and then it can
23 be overwritten again. This is an absolute requirement if there is
24 parity involved. If there is no parity (RAID 0,10) then an
25 implementation might be able to overwrite part of a stripe in place
26 without harming the rest.
27
28 >
29 > A raid 1 should read data faster than a lone disk. A raid 5 or 6 should
30 > read noticeably faster because it's reading across more than one disk.
31
32 More-or-less. RAID 1 is going to generally benefit from lower latency
33 because reads can be divided across mirrored copies (and there could
34 be more than one replica). Any of the striped modes are going to be
35 the same as a single disk on latency, but will have much greater
36 bandwidth. That bandwidth gain applies to both reading and writing,
37 as long as the data is sequential.
38
39 This is why it is important to understand your application. There is
40 no one "best" RAID implementation. They all have pros and cons
41 depending on whether you care more about latency vs bandwidth and also
42 read vs write.
43
44 And of course RAID isn't the only solution out there for this stuff.
45 Distributed filesystems also have pros and cons, and often those have
46 multiple modes of operation on top of this (usually somewhat mirroring
47 the options available for RAID but across multiple hosts).
48
49 For general storage I'm using zfs with raid1 pairs of disks (the pool
50 can have multiple pairs), and for my NAS for larger-scale media/etc
51 storage I'm using lizardfs. I'd use ceph instead in any kind of
52 enterprise setup, but that is much more RAM-hungry and I'm cheap.
53
54 --
55 Rich