[fedora-virt] Virt Disk Performance

Richard W.M. Jones rjones at redhat.com
Sun Oct 30 20:59:35 UTC 2011


On Sun, Oct 30, 2011 at 04:56:51PM +0000, Ken Smith wrote:
> Richard W.M. Jones wrote:
> >On Sun, Oct 30, 2011 at 08:28:30AM +0000, Ken Smith wrote:
> >>Hi, I have two virtual machine setups, one is FC13 and the other is
> >>FC14, using kvm and guests created using the Virtual Machine Manager.
> >>
> >>I have noticed that the disk performance is slower than I would have
> >>expected. Here are some figures
> >>
> >>FC14 Host (i7, 8Gb memory, Two 1Tb sata disks in soft Raid0)
> >>
> >>      Host, 9.76 MBytes/Sec
> Host file system Ext4 formatted on md0, Intel MB
> >>      Centos 5.6 Guest, 6.45 MBytes/Sec
> Virtio, QEMU/RAW, No Specific cache setting

Is the raw file sparse or fully allocated?  It makes a difference if
the host is having to find and allocate blocks while writing.  But
nevertheless, this is about what I'd expect.

> >>      RedHat 8 Guest, 0.426 Mbytes/Sec
> Correction this is FC8, IDE Device, QEMU/RAW, No Specific cache setting

IDE, so we'd expect the performance to be terrible, and it is.  IDE is
just there for compatibility.

In general the best performance is going to be when you use a host LV
(or partition) and avoid files.  In the guest you should enable
virtio.  And for best performance make sure you are using the most
recent qemu and kernel since a lot of work last year went into
improving virtio.

Here are some numbers from my laptop (consumer SATA drive) which has
had not really any tuning or attention to performance.  The numbers
are from the command:

  dd if=/dev/zero of=<output> bs=8k count=131072 conv=fsync

  Host (F17) write to LV:                               59.5 MB/s
  Guest (F16, virtio) write to file on ext4 filesystem: 37.4 MB/s

> I've pulled most of the information you requested. See above. I
> don't see any specific cache settings on either machine. Is there
> somewhere I would see the default setting on the machine?

I'm out of the loop on what the default caching policy is these days.
Hopefully libvirt is at least choosing a safe one.

> The raw
> files are the full size of the filesystem they are intended to hold.

Does this mean they're not sparse?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v


More information about the virt mailing list