From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D0780138350 for ; Sun, 3 May 2020 22:34:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CFF0EE091D; Sun, 3 May 2020 22:34:40 +0000 (UTC) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9D887E08F9 for ; Sun, 3 May 2020 22:34:39 +0000 (UTC) Received: by mail-ed1-f42.google.com with SMTP id d16so11972054edv.8 for ; Sun, 03 May 2020 15:34:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=lEN9fS3N4dKJJtieRkAx+CADZGkQ4RHYcGy5foS6nos=; b=pc9JEu5pkFyRqfFrQw2pv+XtEYn2ssf/PaVBlW+NcujsKMRtNOX+3MlIO5P2SJ8E+5 81qhGr65TSXJpGrciZQOqBfTS1bitdYP5vm3MFDIFglkMOZpHhxhRM0N+/bikbWVTP7f AgNbaIvaHEuhUFgOJs/Gfgqo9gbZSP2A6QzbSnOv9ocY2p+Ll/d0LtEjS7rjv7TEET31 3izZUBbYFx1smr+b9mqmOAx0K0VIGibcCYFvADevjdFDd8i56lSjRMe6QPt8lbg/HH3h +LA1jZaaU5uACfXDnVDYcG3oKfikhO0xrJLWXZMavzdoi92A1GiHROBZ24SnNTeHmKMy 9jHw== X-Gm-Message-State: AGi0PuYVZOIeO8qkQWsW2L+3cJFM6ENl6/HRigdVaErgP8ibpDcfZCg8 ujoDzt+Glfr8ZELEZcYEnM7MH0IVgcwY8Hxiy3SvARUD X-Google-Smtp-Source: APiQypJ0E2ntXiLV/MvMCGYkpjZSyuZqhGxUvODeiSbwZrJjMKU6lpAfx058Y46CVaVo+Yq3uoL9Nq3SB9TA7FU2ZUY= X-Received: by 2002:a05:6402:2214:: with SMTP id cq20mr12740186edb.320.1588545277844; Sun, 03 May 2020 15:34:37 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: In-Reply-To: From: Rich Freeman Date: Sun, 3 May 2020 18:34:27 -0400 Message-ID: Subject: Re: [gentoo-user] which linux RAID setup to choose? To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: afed946d-eba5-4fb3-97ef-1a043e82510b X-Archives-Hash: b49238127c775d4291fa667f72a14166 On Sun, May 3, 2020 at 5:32 PM antlists wrote: > > On 03/05/2020 21:07, Rich Freeman wrote: > > I don't think you should focus so much on whether read=write in your > > RAID. I'd focus more on whether read and write both meet your > > requirements. > > If you think about it, it's obvious that raid-1 will read faster than it > writes - it has to write two copies while it only reads one. Yes. The same is true for RAID10, since it has to also write two copies of everything. > > Likewise, raids 5 and 6 will be slower writing than reading - for a > normal read it only reads the data disks, but when writing it has to > write (and calculate!) parity as well. Yes, but with any of the striped modes (0, 5, 6, 10) there is an additional issue. Writes have to generally be made in entire stripes, so if you overwrite data in-place in units smaller than an entire stripe, then the entire stripe needs to first be read, and then it can be overwritten again. This is an absolute requirement if there is parity involved. If there is no parity (RAID 0,10) then an implementation might be able to overwrite part of a stripe in place without harming the rest. > > A raid 1 should read data faster than a lone disk. A raid 5 or 6 should > read noticeably faster because it's reading across more than one disk. More-or-less. RAID 1 is going to generally benefit from lower latency because reads can be divided across mirrored copies (and there could be more than one replica). Any of the striped modes are going to be the same as a single disk on latency, but will have much greater bandwidth. That bandwidth gain applies to both reading and writing, as long as the data is sequential. This is why it is important to understand your application. There is no one "best" RAID implementation. They all have pros and cons depending on whether you care more about latency vs bandwidth and also read vs write. And of course RAID isn't the only solution out there for this stuff. Distributed filesystems also have pros and cons, and often those have multiple modes of operation on top of this (usually somewhat mirroring the options available for RAID but across multiple hosts). For general storage I'm using zfs with raid1 pairs of disks (the pool can have multiple pairs), and for my NAS for larger-scale media/etc storage I'm using lizardfs. I'd use ceph instead in any kind of enterprise setup, but that is much more RAM-hungry and I'm cheap. -- Rich