From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: [libvirt] Qemu/KVM is 3x slower under libvirt (due to vhost=on) Date: Wed, 28 Sep 2011 10:53:40 +0100 Message-ID: <20110928095339.GP21102@redhat.com> References: <4E82118D.2010702@shiftmail.org> <20110928075138.GC21102@redhat.com> <4E82E6AF.5070009@shiftmail.org> <20110928092859.GO21102@redhat.com> <4E82ED8D.10004@shiftmail.org> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: kvm@vger.kernel.org, libvir-list@redhat.com To: Reeted Return-path: Received: from mx1.redhat.com ([209.132.183.28]:24675 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931Ab1I1Jxv (ORCPT ); Wed, 28 Sep 2011 05:53:51 -0400 Content-Disposition: inline In-Reply-To: <4E82ED8D.10004@shiftmail.org> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Sep 28, 2011 at 11:49:01AM +0200, Reeted wrote: > On 09/28/11 11:28, Daniel P. Berrange wrote: > >On Wed, Sep 28, 2011 at 11:19:43AM +0200, Reeted wrote: > >>On 09/28/11 09:51, Daniel P. Berrange wrote: > >>>>This is my bash commandline: > >>>> > >>>>/opt/qemu-kvm-0.14.1/bin/qemu-system-x86_64 -M pc-0.14 -enable-kvm > >>>>-m 2002 -smp 2,sockets=2,cores=1,threads=1 -name vmname1-1 -uuid > >>>>ee75e28a-3bf3-78d9-3cba-65aa63973380 -nodefconfig -nodefaults > >>>>-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/vmname1-1.monitor,server,nowait > >>>>-mon chardev=charmonitor,id=monitor,mode=readline -rtc base=utc > >>>>-boot order=dc,menu=on -drive file=/dev/mapper/vgPtpVM-lvVM_Vmname1_d1,if=none,id=drive-virtio-disk0,boot=on,format=raw,cache=none,aio=native > >>>>-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 > >>>>-drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw,cache=none,aio=native > >>>>-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 > >>>>-net nic,model=virtio -net tap,ifname=tap0,script=no,downscript=no > >>>>-usb -vnc 127.0.0.1:0 -vga cirrus -device > >>>>virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 > >>>This shows KVM is being requested, but we should validate that KVM is > >>>definitely being activated when under libvirt. You can test this by > >>>doing: > >>> > >>> virsh qemu-monitor-command vmname1 'info kvm' > >>kvm support: enabled > >> > >>I think I would see a higher impact if it was KVM not enabled. > >> > >>>>Which was taken from libvirt's command line. The only modifications > >>>>I did to the original libvirt commandline (seen with ps aux) were: > > > >>>>- Network was: -netdev tap,fd=17,id=hostnet0,vhost=on,vhostfd=18 > >>>>-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:05:36:60,bus=pci.0,addr=0x3 > >>>>Has been simplified to: -net nic,model=virtio -net > >>>>tap,ifname=tap0,script=no,downscript=no > >>>>and manual bridging of the tap0 interface. > >>>You could have equivalently used > >>> > >>> -netdev tap,ifname=tap0,script=no,downscript=no,id=hostnet0,vhost=on > >>> -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:05:36:60,bus=pci.0,addr=0x3 > >>It's this! It's this!! (thanks for the line) > >> > >>It raises boot time by 10-13 seconds > >Ok, that is truely bizarre and I don't really have any explanation > >for why that is. I guess you could try 'vhost=off' too and see if that > >makes the difference. > > YES! > It's the vhost. With vhost=on it takes about 12 seconds more time to boot. > > ...meaning? :-) I've no idea. I was always under the impression that 'vhost=on' was the 'make it go much faster' switch. So something is going wrong here that I cna't explain. Perhaps one of the network people on this list can explain... To turn vhost off in the libvirt XML, you should be able to use for the interface in question,eg Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|