All of lore.kernel.org
 help / color / mirror / Atom feed
From: Austin S Hemmelgarn <ahferroin7@gmail.com>
To: Rich Freeman <r-btrfs@thefreemanclan.net>
Cc: Bob Williams <linux@barrowhillfarm.org.uk>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Is it necessary to balance a btrfs raid1 array?
Date: Wed, 10 Sep 2014 10:41:07 -0400	[thread overview]
Message-ID: <54106303.60906@gmail.com> (raw)
In-Reply-To: <CAGfcS_=DKk1g87mvKBRyXmycjMjoSFbi3P6Qrrn5KQ0nD0HStg@mail.gmail.com>

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

On 2014-09-10 09:48, Rich Freeman wrote:
> On Wed, Sep 10, 2014 at 9:06 AM, Austin S Hemmelgarn
> <ahferroin7@gmail.com> wrote:
>> Normally, you shouldn't need to run balance at all on most BTRFS
>> filesystems, unless your usage patterns vary widely over time (I'm
>> actually a good example of this, most of the files in my home directory
>> are relatively small, except for when I am building a system with
>> buildroot or compiling a kernel, and on occasion I have VM images that
>> I'm working with).
> 
> Tend to agree, but I do keep a close eye on free space.  If I get to
> the point where I'm over 90% allocated to chunks with lots of unused
> space otherwise I run a balance.  I tend to have the most problems
> with my root/OS filesystem running on a 64GB SSD, likely because it is
> so small.
> 
> Is there a big performance penalty running mixed chunks on an SSD?  I
> believe this would get rid of the risk of ENOSPC issues if everything
> gets allocated to chunks.  There are obviously no issues with random
> access on an SSD, but there could be other problems (cache
> utilization, etc).
There shouldn't be any more performance penalty than for normally
running mixed chunks.  Also, a 64GB SSD is not small, I use a pair of
64GB SSD's in a BTRFS RAID1 configuration for root on my desktop, and
consistently use less than a quarter (12G on average) of the available
space, and that's with stuff like LibreOffice and the entire OpenClipart
distribution (although I'm not running an 'enterprise' distribution, and
keep /tmp and /var/tmp on tmpfs).
> 
> I tend to watch btrfs fi sho and if the total space used starts
> getting high then I run a balance.  Usually I run with -dusage=30 or
> -dusage=50, but sometimes I get to the point where I just need to do a
> full balance.  Often it is helpful to run a series of balance commands
> starting at -dusage=10 and moving up in increments.  This at least
> prevents killing IO continuously for hours.  If we can get to a point
> where balancing can operate at low IO priority that would be helpful.
> 
> IO priority is a problem in btrfs in general.  Even tasks run at idle
> scheduling priority can really block up a disk.  I've seen a lot of
> hurry-and-wait behavior in btrfs.  It seems like the initial commit to
> the log/etc is willing to accept a very large volume of data, and then
> when all the trees get updated the system grinds to a crawl trying to
> deal with all the data that was committed.  The problem is that you
> have two queues, with the second queue being rate-limiting but the
> first queue being the one that applies priority control.  What we
> really need is for the log to have controls on how much it accepts so
> that the updating of the trees/etc never is rate-limiting.   That will
> limit the ability to have short IO write bursts, but it would prevent
> low-priority writes from blocking high-priority read/writes.

You know, you can pretty easily control bandwidth utilization just using
cgroups.  This is what I do, and I get much better results with cgroups
and the deadline IO scheduler than I ever did with CFQ. Abstract
priorities are a not bad for controlling relative CPU utilization, but
they really suck for IO scheduling.


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 2455 bytes --]

  reply	other threads:[~2014-09-10 14:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10 12:27 Is it necessary to balance a btrfs raid1 array? Bob Williams
2014-09-10 13:06 ` Austin S Hemmelgarn
2014-09-10 13:48   ` Rich Freeman
2014-09-10 14:41     ` Austin S Hemmelgarn [this message]
2014-09-10 17:44   ` Bob Williams
2014-09-10 18:43 ` Goffredo Baroncelli
2014-09-10 19:32   ` Sean Greenslade
2014-09-10 22:28     ` Goffredo Baroncelli
2014-09-11  1:25       ` Sean Greenslade
2014-09-11  3:51         ` Zygo Blaxell
2014-09-11  4:23           ` Sean Greenslade
2014-09-11  6:55           ` Duncan
2014-09-11  9:56   ` Bob Williams
2014-09-11 11:10     ` Duncan
2014-09-11  4:30 ` Zygo Blaxell
2014-09-11  9:08   ` Bob Williams

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=54106303.60906@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux@barrowhillfarm.org.uk \
    --cc=r-btrfs@thefreemanclan.net \
    /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.