From: Calvin Walton <calvin.walton@kepstin.ca>
To: "Toralf Förster" <toralf.foerster@gmx.de>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: shall I use BTRFS sub-volumes for top-level directories ?
Date: Wed, 13 May 2015 13:46:07 -0400 [thread overview]
Message-ID: <1431539167.9076.9.camel@kepstin.ca> (raw)
In-Reply-To: <55535C12.3010807@gmx.de>
On Wed, 2015-05-13 at 16:13 +0200, Toralf Förster wrote:
> To support the Gentoo Linux ecosystem I do maintain a server as a
> tinderbox. I create chroot images based on various Gentoo minmal ISO
> images. I usually run 4 chroot image jobs in parallel. The chroots
> are full-filled over days/weeks with the compiled output. Issues
> during that are filed into Gentoo's bugzilla.
>
> If an image is "full" (~35 GB with many files + directories in it)
> or completely bricked I create a new one of the same type. The old
> is kept for weeks/months to further serve to bug reports questions.
> But old images are rarely accessed usually.
>
> Because deleting a chroot image takes awfully long and b/c I
> experience iowait spikes even if the 3 TB drive isn't filled by more
> than 50% I do wonder, if it would make sense to create a btrfs
> subvolume for each chroot image ?
> The deletion of a subvolume should be fast compared to recursivly
> deleting a 35 GB file system structure, right ?
Unfortunately, this isn't entirely the case… Deleting a subvolume
actually triggers a background garbage-collecting thread to run in the
kernel (named "btrfs-cleaner") which goes recursively through the
deleted tree to unallocate the files.
It will probably save a bit of IO compared to doing it with "rm -r",
because there is less metadata updating. (You'll probably see that the
"btrfs-transaction" process has high disk io during "rm -r", since it
has to commit metadata periodically while the delete is still in
progress.)
Unfortunately the IO scheduling on btrfs-cleaner currently isn't
great, so it'll likely still cause io spikes, reducing performance of
other applications while it runs.
As with all things, it's probably best if you just try it and see!
> (And BTW what's about re-balancing of the BTRFS-tree during the
> daily usage: wouldn't this profit from that too ?
All subvolumes share the same allocated space for metadata and data,
so using subvolumes vs. directories currently won't make any
difference regarding rebalancing.
--
Calvin Walton <calvin.walton@kepstin.ca>
next prev parent reply other threads:[~2015-05-13 17:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 14:13 shall I use BTRFS sub-volumes for top-level directories ? Toralf Förster
2015-05-13 17:46 ` Calvin Walton [this message]
2015-05-19 13:16 ` Toralf Förster
2015-05-21 14:39 ` Toralf Förster
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=1431539167.9076.9.camel@kepstin.ca \
--to=calvin.walton@kepstin.ca \
--cc=linux-btrfs@vger.kernel.org \
--cc=toralf.foerster@gmx.de \
/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).