From: Tomasz Pala <gotar@polanet.pl>
To: "Ellis H. Wilson III" <ellisw@panasas.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: btrfs-cleaner / snapshot performance analysis
Date: Sat, 10 Feb 2018 23:05:49 +0100 [thread overview]
Message-ID: <20180210220549.GA30438@polanet.pl> (raw)
In-Reply-To: <76e7f364-62b9-5ef1-a8ed-f6fb9e534963@panasas.com>
On Sat, Feb 10, 2018 at 13:29:15 -0500, Ellis H. Wilson III wrote:
>> Well, sometimes those answers help. :) "Oh, yes, I disabled qgroups, I
>> didn't even realize I had those, and now the problem is gone."
>
> I meant less than helpful for me, since for my project I need detailed
> and fairly accurate capacity information per sub-volume, and the
You won't have anything close to "accurate" in btrfs - quotas don't
include space wasted by fragmentation, which happens to allocate from tens
to thousands times (sic!) more space than the files itself.
Not in some worst-case scenarios, but in real life situations...
I got 10 MB db-file which was eating 10 GB of space after a week of
regular updates - withOUT snapshotting it. All described here.
> relationship between qgroups and subvolume performance wasn't being
> spelled out in the responses. Please correct me if I am wrong about
> needing qgroups enabled to see detailed capacity information
> per-subvolume (including snapshots).
Yes, you need that. But while snapshots are in use, it's not
straighforward to interpret the values, especially in regard of
exclusive spaace (which is not a btrfs limitation, just pure logical
conclusion) - this was also described in my thread.
> course) or how many subvolumes/snapshots there are. If I know that
> above N snapshots per subvolume performance tanks by M%, I can apply
> limits on the use-case in the field, but I am not aware of those kinds
> of performance implications yet.
This doesn't work like this. It all depends on data that are subject of
snapshots, especially how they are updated. How exactly, including write
patterns.
I think you expect answers that can't be formulated - with fs architecture so
advanced as ZFS or btrfs it's behavior can't be analyzed for simple
answers like 'keep less than N snapshots'.
If you want PRACTICAL rules, there is one not known commonly: since
the btrfs limitation is that defragmentation breaks CoW links, so all
your snapshots can grow like regular copies, defrag data just
before snapshotting them.
> I noticed the problem when Thunderbird became completely unresponsive.
Is it using some database engine for storage? Mark the files with nocow.
This is an exception of easy-answer: btrfs doesn't handle databases with
CoW. Period. Doesn't matter if snapshotted or not, ANY database files
(systemd-journal, PostgreSQL, sqlite, db) are not handled at all. They
slow down entire system to the speed of cheap SD card.
If you have btrfs on your home partition, make sure that AT LEAST all
$USER/.cache directories are chattr +C. The same applies to entire /var
partition and dozen of other various directories with user-databases
(~/.mozilla/firefox, ~/.ccache and many many more application-specific).
In fact, if you want the quotas to be accurate, you NEED to mount every
volume with possibly hostile write patterns (like /home) as nocow.
Actually, if you do not use compression and don't need checksums of data
blocks, you may want to mount all the btrfs with nocow by default.
This way the quotas would be more accurate (no fragmentation _between_
snapshots) and you'll have some decent performance with snapshots.
If that is all you care.
--
Tomasz Pala <gotar@pld-linux.org>
next prev parent reply other threads:[~2018-02-10 22:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-09 16:45 btrfs-cleaner / snapshot performance analysis Ellis H. Wilson III
2018-02-09 17:10 ` Peter Grandi
2018-02-09 20:36 ` Hans van Kranenburg
2018-02-10 18:29 ` Ellis H. Wilson III
2018-02-10 22:05 ` Tomasz Pala [this message]
2018-02-11 15:59 ` Ellis H. Wilson III
2018-02-11 18:24 ` Hans van Kranenburg
2018-02-12 15:37 ` Ellis H. Wilson III
2018-02-12 16:02 ` Austin S. Hemmelgarn
2018-02-12 16:39 ` Ellis H. Wilson III
2018-02-12 18:07 ` Austin S. Hemmelgarn
2018-02-13 13:34 ` E V
2018-02-11 1:02 ` Hans van Kranenburg
2018-02-11 9:31 ` Andrei Borzenkov
2018-02-11 17:25 ` Adam Borowski
2018-02-11 16:15 ` Ellis H. Wilson III
2018-02-11 18:03 ` Hans van Kranenburg
2018-02-12 14:45 ` Ellis H. Wilson III
2018-02-12 17:09 ` Hans van Kranenburg
2018-02-12 17:38 ` Ellis H. Wilson III
2018-02-11 6:40 ` Qu Wenruo
2018-02-14 1:14 ` Darrick J. Wong
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=20180210220549.GA30438@polanet.pl \
--to=gotar@polanet.pl \
--cc=ellisw@panasas.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).