linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Austin S Hemmelgarn <ahferroin7@gmail.com>
To: Brendan Heading <brendanheading@gmail.com>,
	Duncan <1i5t5.duncan@cox.net>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: BTRFS as image store for KVM?
Date: Wed, 16 Sep 2015 08:25:07 -0400	[thread overview]
Message-ID: <55F95FA3.1040409@gmail.com> (raw)
In-Reply-To: <CA+BsyQ44kPzk1txVUro7vv2=CH6SF3=9zoSkpMVmqnjtuws5Zw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2646 bytes --]

On 2015-09-16 07:35, Brendan Heading wrote:
>> Btrfs has two possible solutions to work around the problem.  The first
>> one is the autodefrag mount option, which detects file fragmentation
>> during the write and queues up the affected file for a defragmenting
>> rewrite by a lower priority worker thread.  This works best on the small
>> end, because as file size increases, so does time to actually write it
>> out, and at some point, depending on the size of the file and how busy
>> the database/VM is, writes are (trying to) come in faster than the file
>> can be rewritten.  Typically, there's no problem under a quarter GiB,
>> with people beginning to notice performance issues at half to 3/4 GiB,
>> tho on fast disks and not too busy VMs/DBs (which may well include your
>> home system, depending on what you use the VMs for), you might not see
>> problems until size reaches 2 GiB or so.  As such, autodefrag tends to be
>> a very good option for firefox sqlite database files, for instance, as
>> they tend to be small enough not to have issues.  But it's not going to
>> work so well for multi-GiB VM images.
>
> [unlurking for the first time]
>
> This problem has been faced by a certain very large storage vendor
> whom I won't name, who provide an option similar to the above. Reading
> between the lines I think their approach is to try to detect which
> accesses are read-sequential, and schedule those blocks for rewriting
> in sequence. They also have a feature to run as a background job which
> can be scheduled to run during an off peak period where they can
> reorder entire files that are significantly out of sequence. I'd
> expect the algorithm is intelligent ie there's no need to rewrite
> entire large files that are mostly sequential with a few out-of-order
> sections.
>
> Has anyone considered these options for btrfs ? Not being able to run
> VMs on it is probably going to be a bit of a killer ..
>
3 things to mention here:
1. It's perfectly possible to run VM's on BTRFS, it just takes some 
effort to get decent efficiency, and you can't really over-provision 
storage (the above mentioned effort is to create the file with NOCOW 
set, and then use fallocate or dd to pre-allocate space for it).
2. If you are using a file for the disk image, you are already 
sacrificing performance for portability, it's just a bigger tradeoff 
with BTRFS than most other filesystems on Linux.
3. Almost all of the issues that BTRFS has with VM disk images are also 
present in other filesystems, they are just much worse on BTRFS because 
of the fact that it is COW based.


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 3019 bytes --]

  reply	other threads:[~2015-09-16 12:25 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 21:34 BTRFS as image store for KVM? Gert Menke
2015-09-16  3:00 ` Chris Murphy
2015-09-16  3:57 ` Duncan
2015-09-16 11:35   ` Brendan Heading
2015-09-16 12:25     ` Austin S Hemmelgarn [this message]
2015-09-16 12:41     ` Paul Jones
2015-09-17 17:56   ` Gert Menke
2015-09-17 18:35     ` Chris Murphy
2015-09-17 21:32       ` Gert Menke
2015-09-18  2:00       ` Duncan
2015-09-18  8:32         ` Gert Menke
2015-09-23  7:28         ` Russell Coker
2015-09-18 14:13       ` Austin S Hemmelgarn
2015-09-23  7:24         ` Russell Coker
2015-09-17 18:46     ` Mike Fleetwood
2015-09-17 19:43     ` Hugo Mills
2015-09-17 21:49       ` Gert Menke
2015-09-18  2:22       ` Duncan
2015-09-18  8:59         ` Gert Menke
2015-09-17 22:41     ` Sean Greenslade
2015-09-18  7:34       ` Gert Menke
2015-09-17  4:19 ` Paul Harvey
2015-09-20  1:26 ` Jim Salter
2015-09-25 12:48   ` Rich Freeman
2015-09-25 12:56     ` Jim Salter
2015-09-25 13:04     ` Austin S Hemmelgarn
     [not found]       ` <5605483A.7040103@jrs-s.net>
2015-09-25 13:46         ` Austin S Hemmelgarn
2015-09-25 13:52       ` Jim Salter
2015-09-25 14:02         ` Timofey Titovets
2015-09-25 14:20           ` Austin S Hemmelgarn
2015-09-29 14:12             ` Gert Menke
2015-10-02  4:21             ` Russell Coker
2015-10-02 12:07               ` Austin S Hemmelgarn
2015-10-03  8:32                 ` Russell Coker
2015-10-04  2:09                   ` Duncan
2015-10-04 12:03                     ` Lionel Bouton
2015-10-04 12:21                       ` Rich Freeman
2015-10-05  8:19                         ` Duncan
2015-10-05  8:43                       ` Erkki Seppala
2015-10-05  8:51                         ` Roman Mamedov
2015-10-05 11:16                       ` Lionel Bouton
2015-10-05 11:40                         ` Rich Freeman
2015-10-05 11:54                         ` Austin S Hemmelgarn
     [not found]                       ` <RPG31r00t34oj7R01PG5Us>
2015-10-05 14:04                         ` Duncan
2015-10-05 15:59                           ` Austin S Hemmelgarn

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=55F95FA3.1040409@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=1i5t5.duncan@cox.net \
    --cc=brendanheading@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).