我知道有很多这样的问题,但我尝试了很多次但都没有成功。
我有以下主机配置:
Ubuntu Linux 16.04.1
Linux 4.4.0-64-generic on x86_64
AMD Turion(tm) II Neo N40L Dual-Core Processor, 2 cores
Real memory: 15.24 GB total / 6.37 GB used
并且安装了以下客户操作系统:
Windows Server Core 2016 - 64 bits
客户机 CPU 几乎处于空闲状态,正如 power shell 所报告的:
[10.0.4.135]: PS C:\gitlab> Get-Counter -ComputerName localhost '\Process(*)\% Processor Time' `
>> | Select-Object -ExpandProperty countersamples `
>> | Select-Object -Property instancename, cookedvalue `
>> | Sort-Object -Property cookedvalue -Descending | Select-Object -First 20 `
>> | ft InstanceName,@{L='CPU';E={($_.Cookedvalue/100).toString('P')}} -AutoSize
InstanceName CPU
------------ ---
_total 198,82%
idle 198,82%
sqlwriter 0,00%
msmpeng 0,00%
wlms 0,00%
svchost 0,00%
labnetworkagentservice 0,00%
labagentservice 0,00%
msdepsvc 0,00%
svchost 0,00%
bash 0,00%
wmiprvse 0,00%
msdtc 0,00%
svchost 0,00%
wmiprvse 0,00%
conhost 0,00%
bash 0,00%
wsmprovhost 0,00%
gitlab-runner 0,00%
svchost 0,00%
但是主机CPU kvm进程一直很高:
ID Owner CPU Command
24745 libvirt-qemu 50.2 % qemu-system-x86_64 -enable-kvm -name diagon-alley -S -machine pc-i440fx-xenial,a ...
这是我的域 xml:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>diagon-alley</name>
<uuid>f57b9c74-ea50-11e6-b06d-076dfee54ac7</uuid>
<memory unit='KiB'>976562</memory>
<currentMemory unit='KiB'>976562</currentMemory>
<vcpu placement='static'>2</vcpu>
<cputune>
<vcpupin vcpu='0' cpuset='0'/>
<vcpupin vcpu='1' cpuset='1'/>
</cputune>
<os>
<type arch='x86_64' machine='pc-i440fx-xenial'>hvm</type>
<boot dev='hd'/>
<bootmenu enable='yes'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
<hyperv>
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='4095'/>
</hyperv>
</features>
<cpu mode='host-passthrough'>
<topology sockets='1' cores='2' threads='1'/>
</cpu>
<clock offset='localtime'>
<timer name='rtc' tickpolicy='catchup' track='guest'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none' io='native'/>
<source file='/var/lib/libvirt/images/diagon-alley.qcow2'/>
<target dev='vda' bus='virtio'/>
</disk>
<disk type='file' device='cdrom'>
<source file='/var/lib/libvirt/images/winserver2016-full.iso'/>
<target dev='sda' bus='sata'/>
<readonly/>
</disk>
<disk type='file' device='cdrom'>
<source file='/var/lib/libvirt/images/virtio-win.iso'/>
<target dev='sdb' bus='sata' />
<readonly/>
</disk>
<interface type='bridge'>
<mac address='08:00:27:4c:1a:f3'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' autoport='yes' listen='127.0.0.1'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<!--
<video>
<model type='qxl' vram='16384' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
-->
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</memballoon>
</devices>
</domain>
我还有什么可以尝试降低 CPU 消耗的方法吗?谢谢您的帮助