linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "G. Richard Bellamy" <rbellamy@pteradigm.com>
To: Chris Murphy <lists@colorremedies.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: Large files, nodatacow and fragmentation
Date: Thu, 14 Aug 2014 07:30:28 -0700	[thread overview]
Message-ID: <CADw2B2MGyDAvAxrZOML0kX_shdFD6QSyMV9XWxKfJAoZpLXsSQ@mail.gmail.com> (raw)
In-Reply-To: <9EB33BE3-FAC0-4AE8-BB95-ABE68C578D47@colorremedies.com>

On Wed, Aug 13, 2014 at 9:23 PM, Chris Murphy <lists@colorremedies.com> wrote:
> lsattr /var/lib/libvirt/images/atlas.qcow2
>
> Is the xattr actually in place on that file?

2014-08-14 07:07:36
$ filefrag /var/lib/libvirt/images/atlas.qcow2
/var/lib/libvirt/images/atlas.qcow2: 46378 extents found
2014-08-14 07:08:34
$ lsattr /var/lib/libvirt/images/atlas.qcow2
---------------C /var/lib/libvirt/images/atlas.qcow2

So, yeah, the attribute is set.

>
> It will fragment somewhat but I can't say that I've seen this much fragmentation with xattr C applied to qcow2. What's the workload? How was the qcow2 created? I recommend -o preallocation=metadata,compat=1.1,lazy_refcounts=on when creating it. My workloads were rather simplistic: OS installs and reinstalls. What's the filesystem being used in the guest that's using the qcow2 as backing?

When I created the file, I definitely preallocated the metadata, but
did not set compat or lazy_refcounts. However, isn't that more a
function of how qemu + KVM managed the image, rather than how btrfs?
This is a p2v target, if that matters. Workload has been minimal since
virtualizing because I have yet to get usable performance with this
configuration. The filesystem in the guest is Win7 NTFS. I have seen
massive thrashing of the underlying volume during VSS operations in
the guest, if that signifies.

>
> It might be that your workload is best suited for a preallocated raw file that inherits +C, or even possibly an LV.

I'm close to that decision. As I mentioned, I much prefer the btrfs
subvolume story over lvm, so moving to raw is probably more desirable
than that... however, then I run into my lack of understanding of the
difference between qcow2 and raw with respect to recoverability, e.g.
does raw have the same ACID characteristics as a qcow2 image, or is
atomicity a completely separate concern from the format? The ability
for the owning process to recover from corruption or inconsistency is
a key factor in deciding whether or not to turn COW off in btrfs - if
your overlying system is capable of such recovery, like a database
engine or (presumably) virtualization layer, then COW isn't a
necessary function from the underlying system.

So, just since I started this reply, you can see the difference in
fragmentation:
2014-08-14 07:25:04
$ filefrag /var/lib/libvirt/images/atlas.qcow2
/var/lib/libvirt/images/atlas.qcow2: 46461 extents found

That's 17 minutes, an OS without interaction (I wasn't doing anything
with it, but it may have been doing its own work like updates, etc.),
and I see an fragmentation increase of 83 extents, and a raid10 volume
that was beating itself up (I could hear the drives chattering away as
they worked).

-rb

  reply	other threads:[~2014-08-14 14:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11 18:36 Large files, nodatacow and fragmentation G. Richard Bellamy
2014-08-11 19:14 ` Roman Mamedov
2014-08-11 21:37   ` G. Richard Bellamy
2014-08-11 23:31   ` Chris Murphy
2014-08-14  3:57     ` G. Richard Bellamy
2014-08-14  4:23       ` Chris Murphy
2014-08-14 14:30         ` G. Richard Bellamy [this message]
2014-08-14 15:05           ` Austin S Hemmelgarn
2014-08-14 18:15             ` G. Richard Bellamy
2014-08-14 18:40           ` Chris Murphy
2014-08-14 23:16             ` G. Richard Bellamy
2014-08-15  1:05               ` Chris Murphy
2014-09-02 18:31                 ` G. Richard Bellamy
2014-09-02 19:17                   ` Chris Murphy
2014-09-02 19:17                   ` Austin S Hemmelgarn
2014-09-02 23:30                     ` G. Richard Bellamy
2014-09-03  6:01                       ` Chris Murphy
2014-09-03  6:26                         ` Chris Murphy
2014-09-03 15:45                           ` G. Richard Bellamy
2014-09-03 18:53                             ` Clemens Eisserer

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=CADw2B2MGyDAvAxrZOML0kX_shdFD6QSyMV9XWxKfJAoZpLXsSQ@mail.gmail.com \
    --to=rbellamy@pteradigm.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.com \
    /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).