From: Benoit Guguin Subject: KVM - IO disk performance - strange behaviour - better performance in guest Date: Mon, 2 Nov 2009 17:21:20 +0100 Message-ID: <200911021721.20285.liste@alixen.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE To: kvm@vger.kernel.org Return-path: Received: from smtp.alixen.fr ([83.169.67.16]:40443 "EHLO smtp.alixen.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755944AbZKBQ35 convert rfc822-to-8bit (ORCPT ); Mon, 2 Nov 2009 11:29:57 -0500 Received: from smtp.orsay.alixen.fr (41-91.252-81.static-ip.oleane.fr [81.252.91.41]) by smtp.alixen.fr (Postfix) with ESMTP id D547C2781EB for ; Mon, 2 Nov 2009 17:20:11 +0100 (CET) Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Hello, I'm currently testing some distribution with uptodate/new KVM : - Ubuntu Karmic 9.10 - Rhel 5.4 I'm using IoZone to test IO disk performance. =46or my test I have dedicated a LVM partition to the IoZone benchmark = : iozone -a -U /mnt/bench/ -f /mnt/bench/test-file -R -b I have done multiple tests with 'cache=3Dnone', cache=3D'writeback' and= =20 cache=3D'writethrough'. Inside the VM I have tried, for the filesystem, the options data=3Dord= ered and=20 data=3Dwriteback. All my tests have different results but at last, something is strange := in a=20 VM, IO Disk performance are better than in the host system for little f= iles and=20 blocks and worse for big files and blocks. I can give all my iozone benchmark results if you'd like ;). Well I do some assumption : - KVM provide a cache for read/write operations - KVM tells to the guest that data are written, but in fact, they are n= ot. Can someone explain me this behaviour ? Can I control it ? Can this lead to data corruption in case of hardware crash ? More informations =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D Ubuntu 9.10 ----------------------------------- - host : Ubuntu 9.10 ; kernel 2.6.31 ; qemu-kvm 0.11 ; lvm dedicated pa= rtition=20 in ext3 (data=3Dordered or writeback). - guest : Ubuntu 9.10 kernel 2.6.31 ; qemu-kvm 0.11 ; virtio disk; lvm=20 dedicated partition in ext3 (data=3Dordered or writeback). - The launch line :=20 /usr/bin/kvm -M pc-0.11 -m 512 -smp 1 -name kvm-ubuntu910 -uuid e5a362= c5- c28a-93dd-043b-d46eb4daba37 -monitor unix:/var/run/libvirt/qemu/kvm- ubuntu910.monitor,server,nowait -boot c -drive file=3D/dev/storage-loca= l-vol2- lvm/kvm-ubuntu910,if=3Dvirtio,index=3D0,cache=3D,boot=3Do= n -drive=20 file=3D/dev/storage-local-vol2-lvm/bench,if=3Dvirtio,cache=3D,index=3D1 - k fr I have done tests with cache=3D'none', cache=3D'writeback' and=20 cache=3D'writethrough'. Everytime, the results was diff=E9rents but in = the same way=20 : in the VM, IO Disk performance are better for little files and bloc= ks and=20 worst for big files and blocks. RHEL5.4 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D Similar tests ... Similar behaviour ... Host : RHEL5.4, ext3, KVM from Redhat; lvm dedicated partitions; driver= disk=20 from Redhat Guest : RHEL5.4, ext3, KVM from Redhat; lvm dedicated partitions; drive= r disk=20 from Redhat