From: Kai Krakow <hurikhan77+btrfs@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: Are nocow files snapshot-aware
Date: Fri, 07 Feb 2014 01:32:27 +0100 [thread overview]
Message-ID: <r5mdsa-hng.ln1@hurikhan77.spdns.de> (raw)
In-Reply-To: pan$9252f$8363907a$3eaa17a6$f558018@cox.net
Duncan <1i5t5.duncan@cox.net> schrieb:
>> Ah okay, that makes it clear. So, actually, in the snapshot the file is
>> still nocow - just for the exception that blocks being written to become
>> unshared and relocated. This may introduce a lot of fragmentation but it
>> won't become worse when rewriting the same blocks over and over again.
>
> That also explains the report of a NOCOW VM-image still triggering the
> snapshot-aware-defrag-related pathology. It was a _heavily_ auto-
> snapshotted btrfs (thousands of snapshots, something like every 30
> seconds or more frequent, without thinning them down right away), and the
> continuing VM writes would nearly guarantee that many of those snapshots
> had unique blocks, so the effect was nearly as bad as if it wasn't NOCOW
> at all!
The question here is: Does it really make sense to create such snapshots of
disk images currently online and running a system. They will probably be
broken anyway after rollback - or at least I'd not fully trust the contents.
VM images should not be part of a subvolume of which snapshots are taken at
a regular and short interval. The problem will go away if you follow this
rule.
The same applies to probably any kind of file which you make nocow - e.g.
database files. Most of those file implement their own way of transaction
protection or COW system, e.g. look at InnoDB files. Neither they gain
anything from using IO schedulers (because InnoDB internally does block
sorting and prioritizing and knows better, doing otherwise even hurts
performance), nor they gain from file system semantics like COW (because it
does its own transactions and atomic updates and probably can do better for
its use case). Similar applies to disk images (imagine ZFS, NTFS, ReFS, or
btrfs images on btrfs). Snapshots can only do harm here (the only
"protection" use case would be to have a backup, but snapshots are no
backups), and COW will probably hurt performance a lot. The only use case is
taking _controlled_ snapshots - and doing it all 30 seconds is by all means
NOT controlled, it's completely undeterministic.
--
Replies to list only preferred.
next prev parent reply other threads:[~2014-02-07 0:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 20:52 Are nocow files snapshot-aware Kai Krakow
2014-02-05 1:22 ` Josef Bacik
2014-02-05 2:02 ` David Sterba
2014-02-05 18:17 ` Kai Krakow
2014-02-06 2:38 ` Duncan
2014-02-07 0:32 ` Kai Krakow [this message]
2014-02-07 1:01 ` cwillu
2014-02-07 1:28 ` Chris Murphy
2014-02-07 21:07 ` Kai Krakow
2014-02-07 21:31 ` Chris Murphy
2014-02-07 22:26 ` Kai Krakow
2014-02-08 6:34 ` Duncan
2014-02-08 8:50 ` Kai Krakow
2014-02-07 7:06 ` Duncan
2014-02-07 21:58 ` Kai Krakow
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=r5mdsa-hng.ln1@hurikhan77.spdns.de \
--to=hurikhan77+btrfs@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).