linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: Kai Krakow <hurikhan77@gmail.com>, linux-btrfs@vger.kernel.org
Subject: Re: Very slow balance / btrfs-transaction
Date: Tue, 7 Feb 2017 14:58:35 -0500	[thread overview]
Message-ID: <323c7434-c89a-b795-0022-b4fc87992c35@gmail.com> (raw)
In-Reply-To: <20170207204727.1bcd9b45@jupiter.sol.kaishome.de>

On 2017-02-07 14:47, Kai Krakow wrote:
> Am Mon, 6 Feb 2017 08:19:37 -0500
> schrieb "Austin S. Hemmelgarn" <ahferroin7@gmail.com>:
>
>>> MDRAID uses stripe selection based on latency and other measurements
>>> (like head position). It would be nice if btrfs implemented similar
>>> functionality. This would also be helpful for selecting a disk if
>>> there're more disks than stripesets (for example, I have 3 disks in
>>> my btrfs array). This could write new blocks to the most idle disk
>>> always. I think this wasn't covered by the above mentioned patch.
>>> Currently, selection is based only on the disk with most free
>>> space.
>> You're confusing read selection and write selection.  MDADM and
>> DM-RAID both use a load-balancing read selection algorithm that takes
>> latency and other factors into account.  However, they use a
>> round-robin write selection algorithm that only cares about the
>> position of the block in the virtual device modulo the number of
>> physical devices.
>
> Thanks for clearing that point.
>
>> As an example, say you have a 3 disk RAID10 array set up using MDADM
>> (this is functionally the same as a 3-disk raid1 mode BTRFS
>> filesystem). Every third block starting from block 0 will be on disks
>> 1 and 2, every third block starting from block 1 will be on disks 3
>> and 1, and every third block starting from block 2 will be on disks 2
>> and 3.  No latency measurements are taken, literally nothing is
>> factored in except the block's position in the virtual device.
>
> I didn't know MDADM can use RAID10 on odd amounts of disks...
> Nice. I'll keep that in mind. :-)
It's one of those neat features that I stumbled across by accident a 
while back that not many people know about.  It's kind of ironic when 
you think about it too, since the MD RAID10 profile with only 2 replicas 
is actually a more accurate comparison for the BTRFS raid1 profile than 
the MD RAID1 profile.  FWIW, it can (somewhat paradoxically) sometimes 
get better read and write performance than MD RAID0 across the same 
number of disks.


  reply	other threads:[~2017-02-07 20:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-03 22:13 Very slow balance / btrfs-transaction jb
2017-02-03 23:25 ` Goldwyn Rodrigues
2017-02-04  0:30 ` Jorg Bornschein
2017-02-04  1:07   ` Goldwyn Rodrigues
2017-02-04  1:47   ` Jorg Bornschein
2017-02-04  2:55     ` Lakshmipathi.G
2017-02-04  8:22       ` Duncan
2017-02-06  1:45     ` Qu Wenruo
2017-02-06 16:09       ` Goldwyn Rodrigues
2017-02-07  0:22         ` Qu Wenruo
2017-02-07 15:55           ` Filipe Manana
2017-02-08  0:39             ` Qu Wenruo
2017-02-08 13:56               ` Filipe Manana
2017-02-09  1:13                 ` Qu Wenruo
2017-02-06  9:14     ` Jorg Bornschein
2017-02-06  9:29       ` Qu Wenruo
2017-02-04 20:50   ` Jorg Bornschein
2017-02-04 21:10     ` Kai Krakow
2017-02-06 13:19       ` Austin S. Hemmelgarn
2017-02-07 19:47         ` Kai Krakow
2017-02-07 19:58           ` Austin S. Hemmelgarn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-07-01 14:24 Sidney San Martín

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=323c7434-c89a-b795-0022-b4fc87992c35@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=hurikhan77@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).