KVM CPU 使用率高

KVM CPU 使用率高

我的专用服务器上有自己的 kvm。我创建了五个 kvm。其中一个的 CPU 有问题。有时 top 看起来像这样: 顶部图片

ps aux 显示一个使用了所有可用核心 100% 的进程:

root 24407 396 14.6 2942304 2405368 ? Tl 05:16 1206:08 ./systemd

kvm guest 的 CPU 使用率达到 100% 是什么原因?

编辑:

KVM 客户机(4 核可用)

top - 20:23:26 up 3 days,  8:52,  1 user,  load average: 3.74, 3.98, 3.99
Tasks: 173 total,   3 running, 169 sleeping,   1 stopped,   0 zombie
%Cpu(s):  2.8 us,  2.7 sy,  0.0 ni, 92.2 id,  0.1 wa,  0.0 hi,  1.6 si,  0.6 st
MiB Mem :  16042.4 total,   9542.3 free,   4493.9 used,   2006.3 buff/cache
MiB Swap:   3069.0 total,   3069.0 free,      0.0 used.  11206.7 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                
  719 systemd+  20   0 5441096   1.3g  24428 S   2.0   8.5  68:18.52 mysqld                                                                                                 
  909 systemd+  20   0   38164  12144   3944 S   2.0   0.1  28:36.97 redis-server                                                                                           
 1224 systemd+  20   0    7772   3680   1216 S   1.7   0.0  19:35.42 nginx                                                                                                  
  442 root      20   0 1959824 100084  43752 S   1.3   0.6  20:05.33 dockerd                                                                                                
  481 root      20   0 1690120  40816  24216 S   0.7   0.2   8:32.02 docker-containe       


root      5863  395 14.6 2942304 2405580 ?     Tl   17:31 683:31 ./systemd

主机

top - 20:25:09 up 17 days, 11:38,  1 user,  load average: 2.96, 3.73, 4.12
Tasks: 153 total,   1 running, 152 sleeping,   0 stopped,   0 zombie
%Cpu(s): 52.3 us,  0.8 sy,  0.0 ni, 46.9 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  64209.1 total,   4465.2 free,  20466.1 used,  39277.9 buff/cache
MiB Swap:  32735.0 total,  19767.7 free,  12967.2 used.  43033.6 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                
31747 libvirt+  20   0   18.8g   5.8g   3008 S 397.7   9.2  17446:07 qemu-system-x86 


libvirt+ 31747  358  9.2 19674620 6052068 ?    Sl   Sep18 17450:33 /usr/bin/qemu-system-x86_64 -name guest=knights_s2,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/l7-knights_s2/master-key.aes -machine pc-q35-3.1,accel=kvm,usb=off,dump-guest-core=off -cpu Skylake-Client-IBRS,ss=on,hypervisor=on,tsc_adjust=on,clflushopt=on,umip=on,md-clear=on,ssbd=on,xs6384 -realtime mlock=off -smp 4,sockets=4,cores=1,threads=1 -uuid c0d6ab01-563c-4487-b9ce-9b4a36313a40 -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=27,server,nowait -mon chnitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1 -boot strict=on -devi0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x2 -device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x2.0x1 -device pcie-root-port,port=0x12,chassis=3,id=pci.3, -device pcie-root-port,port=0x13,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x3 -device pcie-root-port,port=0x14,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x4 -device pcie-root-port,port=0x15,chae.0,addr=0x2.0x5 -device pcie-root-port,port=0x16,chassis=7,id=pci.7,bus=pcie.0,addr=0x2.0x6 -device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.2,addr=0x0 -device virtio-serial-pci,id=virtio-seri-drive file=/kvm/disk/knights_s2.img,format=qcow2,if=none,id=drive-virtio-disk0 -device virtio-blk-pci,scsi=off,bus=pci.4,addr=0x0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=2 -driv0-0-0,media=cdrom,readonly=on -device ide-cd,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 -netdev tap,fd=32,id=hostnet0,vhost=on,vhostfd=33 -device virtio-net-pci,netdev=hostnet6a:98:5f,bus=pci.1,addr=0x0 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,fd=34,server,nowait -device virtserialport,bus=virtev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -device usb-tablet,id=input0,bus=usb.0,port=1 -vnc 0.0.0.0:2 -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_six_outputs=1,bus=pcie.0,addr=0x1 -device virtio-balloon-pci,id=balloon0,bus=pci.5,addr=0x0 -object rng-random,id=objrng0,filename=/dev/urandom -device virtio-rng-pci,rng=objrng0,id=rng0,bus= on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on

汤姆

相关内容