From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gordan Bobic Subject: Re: virtio disk slower than IDE? Date: Sun, 15 Nov 2009 22:47:59 +0000 Message-ID: <4B00851F.5060206@bobich.net> References: <4AFEBD59.2090002@bobich.net> <4AFFCF18.1080509@redhat.com> <4AFFED49.9010305@bobich.net> <4AFFFF0D.3090608@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from 78-86-195-86.zone2.bethere.co.uk ([78.86.195.86]:57973 "EHLO sentinel1.shatteredsilicon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751888AbZKOWry (ORCPT ); Sun, 15 Nov 2009 17:47:54 -0500 Received: from ariia.shatteredsilicon.net (ariia.shatteredsilicon.net [10.2.3.1]) by sentinel1.shatteredsilicon.net (Postfix) with ESMTP id 29F504C280 for ; Sun, 15 Nov 2009 22:47:59 +0000 (GMT) In-Reply-To: <4AFFFF0D.3090608@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Dor Laor wrote: > On 11/15/2009 02:00 PM, Gordan Bobic wrote: >> Dor Laor wrote: >>> On 11/14/2009 04:23 PM, Gordan Bobic wrote: >>>> I just tried paravirtualized virtio block devices, and my tests show >>>> that they are approximately 30% slower than emulated IDE devices. I'm >>>> guessing this isn't normal. Is this a known issue or am I likely to >>>> have >>>> mosconfigured something? I'm using 64-bit RHEL/CentOS 5 (both host and >>>> guest). >>> >>> Please try to change the io scheduler on the host to io scheduler, it >>> should boost your performance back. >> >> I presume you mean the deadline io scheduler. I tried that (kernel >> parameter elevator=deadline) and it made no measurable difference >> compared to the cfq scheduler. > > What version of kvm do you use? Is it rhel5.4? It's RHEL 5.4. $ rpm -qa | grep -i kvm kmod-kvm-83-105.el5_4.9 kvm-83-105.el5_4.9 > Can you post the qemu cmdline and the perf test in the guest? Here is what is in the libvirt log: For IDE emulation: LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/root USER=root LOGNAME=root /usr/libexec/qemu-kvm -S -M pc -m 2048 -smp 4 -name RHEL_5_x86-64 -uuid cb44b2c5-e64b-848f-77af-f8e7f02fa2ca -no-kvm-pit-reinjection -monitor pty -pidfile /var/run/libvirt/qemu//RHEL_5_x86-64.pid -boot c -drive file=/var/lib/libvirt/images/RHEL_5_x86-64.img,if=ide,index=0,boot=on -net nic,macaddr=54:52:00:5a:67:4b,vlan=0,model=e1000 -net tap,fd=15,script=,vlan=0,ifname=vnet0 -serial pty -parallel none -usb -vnc 127.0.0.1:0 -k en-gb For virtio: LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/root USER=root LOGNAME=root /usr/libexec/qemu-kvm -S -M pc -m 2048 -smp 4 -name RHEL_5_x86-64 -uuid cb44b2c5-e64b-848f-77af-f8e7f02fa2ca -no-kvm-pit-reinjection -monitor pty -pidfile /var/run/libvirt/qemu//RHEL_5_x86-64.pid -boot c -drive file=/var/lib/libvirt/images/CentOS_5_x86-64.img,if=virtio,index=0,boot=on -net nic,macaddr=54:52:00:5a:67:4b,vlan=0,model=e1000 -net tap,fd=15,script=,vlan=0,ifname=vnet0 -serial pty -parallel none -usb -vnc 127.0.0.1:0 -k en-gb The test is building the Linux kernel (only taking the second run to give the test the benefit of local cache): make clean; make -j8 all; make clean; sync; time make -j8 all This takes about 10 minutes with IDE disk emulation and about 13 minutes with virtio. I ran the tests multiple time with most non-essential services on the host switched off (including cron/atd), and the guest in single-user mode to reduce the "noise" in the test to the minimum, and the results are pretty consistent, with virtio being about 30% behind. > Lastly, do you use cache=wb on qemu? it's just a fun mode, we use > cache=off only. I don't see the option being set in the logs, so I'd guess it's whatever qemu-kvm defaults to. Gordan