Dominique Ramaekers
2015-Mar-13 15:56 UTC
Re: [libvirt-users] Processor usage of qemu process.
Small update: traceFlag T8038 => no improvement... -----Oorspronkelijk bericht----- Van: Dominique Ramaekers Verzonden: vrijdag 13 maart 2015 16:35 Aan: 'Daniel P. Berrange'; Andrey Korolyov CC: libvirt-users@redhat.com Onderwerp: RE: [libvirt-users] Processor usage of qemu process. Results ---------- First I want to show my appreciation to Daniel and Andrey. So thanks... I've implemented Spice, removed the touchpad and implemented enlightenment timer... PCVIRT1 with Windows 8.1 is on 5% host CPU usage... (OK) CmsrvAPP2 with Server 2012 R2 is still on 50% (Bummer...) A new freshly installed Server 2012 R2 with nothing activated or installed on gives 12% (Not completely happy) More tips are welcome.... See traceFlag T8038 section on https://pve.proxmox.com/wiki/Performance_Tweaks I've also noticed it on other sources... On the CmsrvAPP2 the SQL server is a SQL essential, so I have to figure out how to set the traceFlag on a SQL essential... -----Oorspronkelijk bericht----- Van: Daniel P. Berrange [mailto:berrange@redhat.com] Verzonden: vrijdag 13 maart 2015 11:41 Aan: Andrey Korolyov CC: Dominique Ramaekers; libvirt-users@redhat.com Onderwerp: Re: [libvirt-users] Processor usage of qemu process. On Fri, Mar 13, 2015 at 12:58:32PM +0300, Andrey Korolyov wrote:> On Fri, Mar 13, 2015 at 12:35 PM, Daniel P. Berrange > <berrange@redhat.com> wrote: > > On Fri, Mar 13, 2015 at 10:32:14AM +0100, Dominique Ramaekers wrote: > >> Dear Daniel, my XML's: > >> > >> Note: It seems I was to quick, the Windows 8.1 isn't fixed... > >> > >> Windows Server 2015 R2 > >> > >> <domain type='kvm' id='146'> > >> <name>CmsrvAPP2</name> > >> <uuid>02c5daef-662a-85ba-7291-485118badc64</uuid> > >> <memory unit='KiB'>3149824</memory> > >> <currentMemory unit='KiB'>3149824</currentMemory> > >> <memoryBacking> > >> <hugepages/> > >> </memoryBacking> > >> <vcpu placement='static'>4</vcpu> > >> <resource> > >> <partition>/machine</partition> > >> </resource> > >> <os> > >> <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type> > >> <boot dev='hd'/> > >> <boot dev='cdrom'/> > >> <bootmenu enable='yes'/> > >> </os> > >> <features> > >> <acpi/> > >> <apic/> > >> <pae/> > >> </features> > >> <cpu mode='custom' match='exact'> > >> <model fallback='allow'>Westmere</model> > >> <vendor>Intel</vendor> > >> <feature policy='require' name='pbe'/> > >> <feature policy='require' name='rdtscp'/> > >> <feature policy='require' name='est'/> > >> <feature policy='require' name='vmx'/> > >> <feature policy='require' name='ds'/> > >> <feature policy='require' name='smx'/> > >> <feature policy='require' name='ss'/> > >> <feature policy='require' name='vme'/> > >> <feature policy='require' name='dtes64'/> > >> <feature policy='require' name='tm2'/> > >> <feature policy='require' name='ht'/> > >> <feature policy='require' name='dca'/> > >> <feature policy='require' name='pcid'/> > >> <feature policy='require' name='tm'/> > >> <feature policy='require' name='pdcm'/> > >> <feature policy='require' name='pdpe1gb'/> > >> <feature policy='require' name='ds_cpl'/> > >> <feature policy='require' name='pclmuldq'/> > >> <feature policy='require' name='xtpr'/> > >> <feature policy='require' name='acpi'/> > >> <feature policy='require' name='monitor'/> > >> </cpu> > >> <clock offset='localtime'/> > >> <on_poweroff>destroy</on_poweroff> > >> <on_reboot>restart</on_reboot> > >> <on_crash>restart</on_crash> > >> <devices> > >> <emulator>/usr/bin/kvm-spice</emulator> > >> <disk type='file' device='cdrom'> > >> <driver name='qemu' type='raw' cache='none'/> > >> <source file='/var/lib/libvirt/images/poolCmsrvVH2/virtiodrivers.iso'/> > >> <target dev='hda' bus='ide'/> > >> <readonly/> > >> <alias name='ide0-0-0'/> > >> <address type='drive' controller='0' bus='0' target='0' unit='0'/> > >> </disk> > >> <disk type='file' device='cdrom'> > >> <driver name='qemu' type='raw' cache='none'/> > >> <source file='/var/lib/libvirt/images/poolCmsrvVH2/WIN2012R2.iso'/> > >> <target dev='hdc' bus='ide'/> > >> <readonly/> > >> <shareable/> > >> <alias name='ide0-1-0'/> > >> <address type='drive' controller='0' bus='1' target='0' unit='0'/> > >> </disk> > >> <disk type='file' device='disk'> > >> <driver name='qemu' type='raw' cache='none'/> > >> <source file='/var/lib/libvirt/images/poolCmsrvVH2/CmsrvAPP2.raw'/> > >> <target dev='vda' bus='virtio'/> > >> <alias name='virtio-disk0'/> > >> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> > >> </disk> > >> <controller type='ide' index='0'> > >> <alias name='ide0'/> > >> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> > >> </controller> > >> <controller type='usb' index='0'> > >> <alias name='usb0'/> > >> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> > >> </controller> > >> <controller type='pci' index='0' model='pci-root'> > >> <alias name='pci.0'/> > >> </controller> > >> <interface type='bridge'> > >> <mac address='52:54:00:d2:40:25'/> > >> <source bridge='br0'/> > >> <target dev='vnet1'/> > >> <model type='virtio'/> > >> <alias name='net0'/> > >> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> > >> </interface> > >> <serial type='pty'> > >> <source path='/dev/pts/2'/> > >> <target port='0'/> > >> <alias name='serial0'/> > >> </serial> > >> <console type='pty' tty='/dev/pts/2'> > >> <source path='/dev/pts/2'/> > >> <target type='serial' port='0'/> > >> <alias name='serial0'/> > >> </console> > >> <input type='tablet' bus='usb'> > >> <alias name='input0'/> > >> </input> > >> <input type='mouse' bus='ps2'/> > >> <input type='keyboard' bus='ps2'/> > >> <graphics type='vnc' port='5902' autoport='yes' listen='127.0.0.1'> > >> <listen type='address' address='127.0.0.1'/> > >> </graphics> > >> <sound model='ich6'> > >> <alias name='sound0'/> > >> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> > >> </sound> > >> <video> > >> <model type='vmvga' vram='9216' heads='1'/> > >> <alias name='video0'/> > >> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> > >> </video> > >> <memballoon model='virtio'> > >> <alias name='balloon0'/> > >> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> > >> </memballoon> > >> </devices> > >> <seclabel type='dynamic' model='apparmor' relabel='yes'> > >> <label>libvirt-02c5daef-662a-85ba-7291-485118badc64</label> > >> <imagelabel>libvirt-02c5daef-662a-85ba-7291-485118badc64</imagelabel> > >> </seclabel> > >> </domain> > > > > The USB tablet could be a culprint, as could the choice of video mode. > > > > I'd suggest that you want to install the QXL video driver, and setup > > SPICE instead of VNC, along with the SPICE guest agent. This gives a > > much better performing graphics layer, and better performing mouse. > > instead of the USB tablet which is known to have high CPU cost. > > > > Regards, > > Daniel > > There is none of enlightenment timer features enabled, I`d suggest to > start fixing the issue by adding them in the config. USB tablet is a > great problem too for a generated additional workload in idle, though > usb3 tablet connection results in much lower cpu consumption than > usb2.The guest XML shown has not got either USB2 or USB3 controllers present, so the tablet will be operating in USB1 mode which is awful for performance 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 :|
Andrey Korolyov
2015-Mar-13 19:16 UTC
Re: [libvirt-users] Processor usage of qemu process.
As far as I can understand the mentioned improvement is targeted on a polling mode for a MSSQL, there is no wonder for observing relatively high hypervisor CPU consumption without any sign of same consumption in a guest itself. Certain kinds of applications (PBXes, Chrome/Chromium, seemingly MSSQL) may poll some resource very frequently, causing wakeups in the host for guest process and increasing overall running time of a guest process. I`ve heard of none of the mitigations for this class of workload issues, though you can experiment with guest timer settings if you want to. As we are talking in the libvir-list, it is safe to suggest to use native HyperV host to eliminate this problem completely. :)
Dominique Ramaekers
2015-Mar-15 08:57 UTC
Re: [libvirt-users] Processor usage of qemu process.
Ok, thanks Andrey. I experience a behavior that can be placed in your explanation (dough I certainly not a expert :-) ). If SQL guest has a CPU load of 5%, it takes up 50% on the host. Sometimes (late in the evening), the gest cpu load drops to almoust 0% and the host CPU-load drops to about 10% (same as the freshly installed server). So maybe due to the non-activity of the SQL-clients, the SQL-server goes in a kind of rest-state and stops polling for a while until a client accesses the database again or a maintenance plan is started... I'll settle for now and stop tweaking. Here below, a summary of tips: - Setting video to QXL and the display channel to Spice <video> <model type='qxl' ram='65536' vram='65536' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> - Using HyperV enlightenemt timer <features> <hyperv> <relaxed state='on'/> <vapic state='on'/> <spinlocks state='on' retries='8191'/> </hyperv> <features/> <clock ...> <timer name='hypervclock' present='yes'/> </clock> - Delete the tablet entry in the input section Again thanks Daniel and Andrey. -----Oorspronkelijk bericht----- Van: Andrey Korolyov [mailto:andrey@xdel.ru] Verzonden: vrijdag 13 maart 2015 20:16 Aan: Dominique Ramaekers CC: Daniel P. Berrange; libvirt-users@redhat.com Onderwerp: Re: [libvirt-users] Processor usage of qemu process. As far as I can understand the mentioned improvement is targeted on a polling mode for a MSSQL, there is no wonder for observing relatively high hypervisor CPU consumption without any sign of same consumption in a guest itself. Certain kinds of applications (PBXes, Chrome/Chromium, seemingly MSSQL) may poll some resource very frequently, causing wakeups in the host for guest process and increasing overall running time of a guest process. I`ve heard of none of the mitigations for this class of workload issues, though you can experiment with guest timer settings if you want to. As we are talking in the libvir-list, it is safe to suggest to use native HyperV host to eliminate this problem completely. :)