From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Recommendations for balancing as part of regular maintenance?
Date: Fri, 12 Jan 2018 13:24:38 -0500 [thread overview]
Message-ID: <c4908bdb-cd9c-929d-e681-16311b6adbc5@gmail.com> (raw)
In-Reply-To: <e370d8c9-4ff0-9ba5-2ae0-69524152c772@gmail.com>
On 2018-01-08 10:55, Austin S. Hemmelgarn wrote:
> So, for a while now I've been recommending small filtered balances to
> people as part of regular maintenance for BTRFS filesystems under the
> logic that it does help in some cases and can't really hurt (and if done
> right, is really inexpensive in terms of resources). This ended up
> integrated partially in the info text next to the BTRFS charts on
> netdata's dashboard, and someone has now pointed out (correctly I might
> add) that this is at odds with the BTRFS FAQ entry on balances.
>
> For reference, here's the bit about it in netdata:
>
> You can keep your volume healthy by running the `btrfs balance` command
> on it regularly (check `man btrfs-balance` for more info).
>
>
> And here's the FAQ entry:
>
> Q: Do I need to run a balance regularly?
>
> A: In general usage, no. A full unfiltered balance typically takes a
> long time, and will rewrite huge amounts of data unnecessarily. You may
> wish to run a balance on metadata only (see Balance_Filters) if you find
> you have very large amounts of metadata space allocated but unused, but
> this should be a last resort.
>
>
> I've commented in the issue in netdata's issue tracker that I feel that
> the FAQ entry could be better worded (strictly speaking, you don't
> _need_ to run balances regularly, but it's usually a good idea). Looking
> at both though, I think they could probably both be improved, but I
> would like to get some input here on what people actually think the best
> current practices are regarding this (and ideally why they feel that
> way) before I go and change anything.
>
> So, on that note, how does anybody else out there feel about this? Is
> balancing regularly with filters restricting things to small numbers of
> mostly empty chunks a good thing for regular maintenance or not?
OK, I've gotten a lot of good feedback on this, and the general
consensus seems to be:
* If we're going to recommend regular balance, we should explain how it
actually helps things.
* We should mention the performance interactions with qgroups, as well
as warning people off of running other things like scrubs or defrag
concurrently.
* The filters should be reasonably tame in terms of chunk selection.
* BTRFS should ideally get smarter about this kind of thing so the user
doesn't have to be.
To that end, I propose the following text for the FAQ:
Q: Do I need to run a balance regularly?
A: While not strictly necessary for normal operations, running a
filtered balance regularly can help prevent your filesystem from ending
up with ENOSPC issues. The following command run daily on each BTRFS
volume should be more than sufficient for most users:
`btrfs balance start -dusage=25 -dlimit=2..10 -musage=25 -mlimit=2..10`
If you are running a kernel older than version 4.4 and can't upgrade,
the following should be used instead:
`btrfs balance start -dusage=25 -musage=25`
Both of these commands will effectively compact partially full chunks on
the filesystem so that new chunks have more space to be allocated. For
more information on what the commands actually mean, check out `man
btrfs-balance`
When run regularly, both of these should complete extremely fast on most
BTRFS volumes. Note that these may run significantly slower on volumes
which have quotas enabled. Additionally, it's best to make sure other
things aren't putting a lot of load on the filesystem while running a
balance, so try to make sure this doesn't run at the same time as a
scrub or defrag.
A full, unfiltered balance (one without any options passed in) is
completely unnecessary for normal usage of a filesystem.
next prev parent reply other threads:[~2018-01-12 18:24 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 15:55 Recommendations for balancing as part of regular maintenance? Austin S. Hemmelgarn
2018-01-08 16:20 ` ein
2018-01-08 16:34 ` Austin S. Hemmelgarn
2018-01-08 18:17 ` Graham Cobb
2018-01-08 18:34 ` Austin S. Hemmelgarn
2018-01-08 20:29 ` Martin Raiber
2018-01-09 8:33 ` Marat Khalili
2018-01-09 12:46 ` Austin S. Hemmelgarn
2018-01-10 3:49 ` Duncan
2018-01-10 16:30 ` Tom Worster
2018-01-10 17:01 ` Austin S. Hemmelgarn
2018-01-10 18:33 ` Tom Worster
2018-01-10 20:44 ` Timofey Titovets
2018-01-11 13:00 ` Austin S. Hemmelgarn
2018-01-11 8:51 ` Duncan
2018-01-10 4:38 ` Duncan
2018-01-10 12:41 ` Austin S. Hemmelgarn
2018-01-11 20:12 ` Hans van Kranenburg
2018-01-10 21:37 ` waxhead
2018-01-11 12:50 ` Austin S. Hemmelgarn
2018-01-11 19:56 ` Hans van Kranenburg
2018-01-12 18:24 ` Austin S. Hemmelgarn [this message]
2018-01-12 19:26 ` Tom Worster
2018-01-12 19:43 ` Austin S. Hemmelgarn
2018-01-13 22:09 ` Chris Murphy
2018-01-15 13:43 ` Austin S. Hemmelgarn
2018-01-15 18:23 ` Tom Worster
2018-01-16 6:45 ` Chris Murphy
2018-01-16 11:02 ` Andrei Borzenkov
2018-01-16 12:57 ` Austin S. Hemmelgarn
-- strict thread matches above, loose matches on Subject: below --
2018-01-08 21:43 Tom Worster
2018-01-08 22:18 ` Hugo Mills
2018-01-09 12:23 ` Austin S. Hemmelgarn
2018-01-09 14:16 ` Tom Worster
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=c4908bdb-cd9c-929d-e681-16311b6adbc5@gmail.com \
--to=ahferroin7@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).