[fedora-virt] qcow2 and virtio in virt-preview and rawhide

Kevin Wolf kwolf at redhat.com
Mon Feb 28 09:27:16 UTC 2011


Am 26.02.2011 00:58, schrieb Gianluca Cecchi:
> Hello,
> testing in F14 + virt-preview repo with qemu 0.13.91
> Installing a CentOS 5.5 guest with virtio disk in qcow2 format on a
> directory based storage pool seems quite slow (default text install
> for 2,5Gb of data takes about 33 minutes)
> 
> Changing cache mode to writeback improves very much.
> What is the risk of writeback and what is the default?
> What would be advisable as a good compromise between speed and data
> safeness in this version of qemu?

The default cache mode is writethrough.

The difference is that with cache=writethrough, after each write request
we make sure that the data is safe on disk before we tell the guest that
it has succeeded. With cache=writeback/none we don't do that and only
make it sure when the guest issues a cache flush.

A correctly operating guest will always issue cache flushes where
necessary, so the safe default is only required for broken guests. I'm
not 100% sure, but I think CentOS 5.5 should be safe with cache=writeback.

To give you an idea of what kind of problems we're talking about with
broken guests: The failure scenario is that when your host crashes (or
power failure etc.), you may get data loss and file system corruption in
the guest because requests were not completed or were completed out of
order. With cache=writeback chances for this are relatively high because
data is cached in the host RAM (which is big and therefore a lot of data
are lost), whereas with cache=none they are lower (only the disk write
cache of the host is relevant there).

Kevin


More information about the virt mailing list