qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] qemu-img create: set "nocow" flag to solve performance


From: Chunyan Liu
Subject: Re: [Qemu-devel] qemu-img create: set "nocow" flag to solve performance issue on btrfs
Date: Thu, 26 Sep 2013 17:04:34 +0800




2013/9/26 Stefan Hajnoczi <address@hidden>
On Wed, Sep 25, 2013 at 02:38:36PM +0800, Chunyan Liu wrote:
> Btrfs has terrible performance when hosting VM images, even more when the
> guest in those VM are also using btrfs as file system.
> One way to mitigate this bad performance would be to turn off COW
> attributes on VM files (since having copy on write for this kind of data is
> not useful). We could improve qemu-img to ensure they flag newly created
> images as "nocow". For those who want to use Copy-on-write (for
> snapshotting, to share snapshots across VM, etc..) could be able to change
> this behaviour by 'chattr', either globally or per VM.

The full implications of the NOCOW attribute aren't clear to me.  Does
it really mean the file cannot be snapshotted?  
 
Yes, I think so. The benefits brought by COW: data integrity and convenient snapshot, would be disappears.

Or is it purely a data
integrity issue where overwriting data in-place puts that data at risk
in case of hardware/power failure? 

> I wonder could we add a patch to improve qemu-img create, to set 'nocow'
> flag by default on newly created images?

I think that would be fine.  It's a ioctl(FS_IOC_SETFLAGS, FS_NOCOW_FL)
call so not even too btrfs-specific.

OK. I'll prepare the patch. Thanks.

Regards,
Chunyan
 
Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]