From: Josef Bacik <jbacik@fb.com>
To: Daniele Testa <daniele.testa@gmail.com>,
Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: btrfs is using 25% more disk than it should
Date: Sat, 20 Dec 2014 06:02:24 -0500 [thread overview]
Message-ID: <54955740.5070405@fb.com> (raw)
In-Reply-To: <CAN6BF2LhUcrmRrfhJP1scrTLsCyZ2pWNp-_5MQ5spQViPfJc7g@mail.gmail.com>
On 12/20/2014 01:18 AM, Daniele Testa wrote:
> But I read somewhere that compression should be turned off on mounts
> that just store large VM-images. Is that wrong?
>
It doesn't really matter frankly. Usually virt images are preallocated
with fallocate which means compression doesn't happen as writes into
fallocated areas aren't compressed, but you aren't doing that so you
would be getting some compression.
> Btw, I am not pre-allocation space for the images. I use sparse files with:
>
> dd if=/dev/zero of=drive.img bs=1 count=1 seek=300G
>
> It creates the file in a few ms.
> Is it better to use "fallocate" with btrfs?
>
It depends. If you are going to use nodatacow for your virt images then
I would definitely suggest using fallocate since you'll get a nice
contiguous chunk of data for your virt images.
> If I use sparse files, it adds a benefit when I want to copy/move the
> image-file to another server.
> Like if the 300GB sparse file just has 10GB of data in it, I only need
> to copy 10GB when moving it to another server.
> Would the same be true with "fallocate"?
>
No, but send/receive would only copy 10GB, but the resulting file would
be sparse.
> Anyways, would disabling CoW (by putting +C on the parent dir) prevent
> the performance issues and 2*filesize issue?
>
Yes. Thanks,
Josef
next prev parent reply other threads:[~2014-12-20 11:02 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-18 14:59 btrfs is using 25% more disk than it should Daniele Testa
2014-12-19 18:53 ` Phillip Susi
2014-12-19 19:59 ` Daniele Testa
2014-12-19 20:35 ` Phillip Susi
2014-12-19 21:15 ` Josef Bacik
2014-12-19 21:53 ` Phillip Susi
2014-12-19 22:06 ` Josef Bacik
2014-12-20 1:33 ` Duncan
2014-12-19 21:10 ` Josef Bacik
2014-12-19 21:17 ` Josef Bacik
2014-12-20 1:38 ` Duncan
2014-12-20 5:52 ` Zygo Blaxell
2014-12-20 6:18 ` Daniele Testa
2014-12-20 6:59 ` Duncan
2014-12-20 11:02 ` Josef Bacik [this message]
2014-12-20 11:28 ` Josef Bacik
2014-12-23 21:51 ` Zygo Blaxell
2014-12-20 9:15 ` Daniele Testa
2014-12-20 11:23 ` Robert White
2014-12-20 11:39 ` Josef Bacik
2014-12-21 1:40 ` Robert White
2014-12-21 3:04 ` Robert White
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=54955740.5070405@fb.com \
--to=jbacik@fb.com \
--cc=ce3g8jdj@umail.furryterror.org \
--cc=daniele.testa@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).