On Sun, Aug 29, 2010 at 09:34:29PM +0200, Tomasz Chmielewski wrote:Make sure you build your file system with "mkfs.btrfs -m single -d single /dev/whatever". You may well be writing duplicate copies of everything.Christoph Hellwig wrote:Whoa 20gb? That doesn't sound right, COW should just mean we get quite a bit ofThere are a lot of variables when using qemu.I noticed that when btrfs is mounted with default options, when writing
The most important one are:
- the cache mode on the device. The default is cache=writethrough,
which is not quite optimal. You generally do want to use cache=none
which uses O_DIRECT in qemu.
- if the backing image is sparse or not.
- if you use barrier - both in the host and the guest.
i.e. 10 GB on the KVM guest using qcow2 image, 20 GB are written on the
host (as measured with "iostat -m -p").
With ext4 (or btrfs mounted with nodatacow), 10 GB write on a guest
produces 10 GB write on the host
fragmentation, not write everything twice. What exactly is qemu doing? Thanks,