All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: Nicholas D Steeves <nsteeves@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: dstat shows unexpected result for two disk RAID1
Date: Thu, 10 Mar 2016 02:36:27 +0500	[thread overview]
Message-ID: <20160310023627.2e915667@natsu> (raw)
In-Reply-To: <CAD=QJKg6xFSFjJdDyD+v0Rd2afeB-ZRRy2SncC1Db5fyT3cf9A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]

On Wed, 9 Mar 2016 15:25:19 -0500
Nicholas D Steeves <nsteeves@gmail.com> wrote:

> grr.  Gmail is terrible :-/
> 
> I understood that a btrfs RAID1 would at best grab one block from sdb
> and then one block from sdd in round-robin fashion, or at worse grab
> one chunk from sdb and then one chunk from sdd.  Alternatively I
> thought that it might read from both simultaneously, to make sure that
> all data matches, while at the same time providing single-disk
> performance.  None of these was the case.  Running a single
> IO-intensive process reads from a single drive.

No RAID1 implementation reads from disks in a round-robin fashion, as that
would give terrible performance giving disks a constant seek load instead of
the normal linear read scenario.

As for reading at the same time, there's no reason to do that either, since
the data integrity is protected by checksums, and "the other" disk for a
particular data piece is being consulted only in case the checksum did not
match (or when you execute a 'scrub').

It's a known limitation that the disks are in effect "pinned" to running
processes, based on their process ID. One process reads from the same disk,
from the point it started and until it terminates. Other processes by luck may
read from a different disk, thus achieving load balancing. Or they may not,
and you will have contention with the other disk idling. This is unlike MD
RAID1, which knows to distribute read load dynamically to the least-utilized
array members.

Now if you want to do some more performance evaluation, check with your dstat
if both disks happen to *write* data in parallel, when you write to the array,
as ideally they should. Last I checked they mostly didn't, and this almost
halved write performance on a Btrfs RAID1 compared to a single disk.

-- 
With respect,
Roman

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  parent reply	other threads:[~2016-03-09 21:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 20:21 dstat shows unexpected result for two disk RAID1 Nicholas D Steeves
2016-03-09 20:25 ` Nicholas D Steeves
2016-03-09 20:50   ` Goffredo Baroncelli
2016-03-09 21:26   ` Chris Murphy
2016-03-09 22:51     ` Nicholas D Steeves
2016-03-11 23:42     ` Nicholas D Steeves
2016-03-09 21:36   ` Roman Mamedov [this message]
2016-03-09 21:43     ` Chris Murphy
2016-03-09 22:08       ` Nicholas D Steeves
2016-03-10  4:06     ` Duncan
2016-03-10  5:01       ` Chris Murphy
2016-03-10  8:10         ` Duncan
2016-03-12  0:04       ` Nicholas D Steeves
2016-03-12  0:10         ` Nicholas D Steeves
2016-03-12  1:20           ` Chris Murphy
2016-04-06  3:58             ` Nicholas D Steeves
2016-04-06 12:02               ` Austin S. Hemmelgarn
2016-04-22 22:36                 ` Nicholas D Steeves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160310023627.2e915667@natsu \
    --to=rm@romanrm.net \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nsteeves@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.