Author Topic: Poor QEMU Guest Performance  (Read 5307 times)

deepblue

  • Newbie
  • *
  • Posts: 13
  • Karma: +3/-0
  • The only winning move is not to play...
    • View Profile
Poor QEMU Guest Performance
« on: April 23, 2020, 01:34:41 pm »
I am trying to set up an x86_64 QEMU guest to run on my Blackbird, and I am running into a performance issue.

The guest can see all of the processors that I allocate to it, however the CPU speed is capped at 500mhz and the guest is relatively slow. All CPUs that the guest sees are at 100% utilization.

The host reports a fraction of the guest CPU utilization, based on how many threads I give it. 4 threads = ~25% host utilization, 8 threads = ~12%. I am using virt-manager to manage the VMs and to see guest VM utilization.

Any insight on this would be helpful and appreciated.

ClassicHasClass

  • Sr. Member
  • ****
  • Posts: 467
  • Karma: +35/-0
  • Talospace Earth Orbit
    • View Profile
    • Floodgap
Re: Poor QEMU Guest Performance
« Reply #1 on: April 24, 2020, 12:02:31 am »
What's your command line?

deepblue

  • Newbie
  • *
  • Posts: 13
  • Karma: +3/-0
  • The only winning move is not to play...
    • View Profile
Re: Poor QEMU Guest Performance
« Reply #2 on: April 24, 2020, 05:51:24 pm »
I am not 100% sure what you mean by command line, but the host is running Ubuntu 18.04, and the guest is running Mikrotik RouterOS.

ClassicHasClass

  • Sr. Member
  • ****
  • Posts: 467
  • Karma: +35/-0
  • Talospace Earth Orbit
    • View Profile
    • Floodgap
Re: Poor QEMU Guest Performance
« Reply #3 on: April 25, 2020, 01:10:11 pm »
No, I mean, what arguments are you passing to QEMU? Did you build QEMU yourself, or are you using a package?

deepblue

  • Newbie
  • *
  • Posts: 13
  • Karma: +3/-0
  • The only winning move is not to play...
    • View Profile
Re: Poor QEMU Guest Performance
« Reply #4 on: April 26, 2020, 07:50:09 am »
I had a feeling that is what you meant. Here is the command I am using to launch the VM.

Code: [Select]
/usr/bin/qemu-system-x86_64 -name guest=The_Dude,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-9-The_Dude/master-key.aes -machine pc-i440fx-bionic,accel=tcg,usb=off,dump-guest-core=off -cpu kvm32 -m 256 -realtime mlock=off -smp 4,sockets=4,cores=1,threads=1 -uuid cd817648-4846-42d4-936c-10a13375295a -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-9-The_Dude/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -no-kvm-pit-reinjection -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot menu=on,strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x4.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x4 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x4.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x4.0x2 -drive file=/ssd_01/vms/The Dude.vdi,format=vdi,if=none,id=drive-ide0-1-0 -device ide-hd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1 -drive file=/usb_01/samba/Software/mikrotik-6.45.3.iso,format=raw,if=none,id=drive-ide0-1-1,readonly=on -device ide-cd,bus=ide.1,unit=1,drive=drive-ide0-1-1,id=ide0-1-1 -netdev tap,fd=25,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=52:54:00:d3:2c:ea,bus=pci.0,addr=0x3 -netdev tap,fd=28,id=hostnet1 -device e1000,netdev=hostnet1,id=net1,mac=52:54:00:87:a4:b6,bus=pci.0,addr=0x6 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -vnc 127.0.0.1:0,password -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -msg timestamp=on

Edit: I am also using the pre-built QEMU and KVM packages using apt-get
« Last Edit: April 26, 2020, 08:37:11 am by deepblue »

ClassicHasClass

  • Sr. Member
  • ****
  • Posts: 467
  • Karma: +35/-0
  • Talospace Earth Orbit
    • View Profile
    • Floodgap
Re: Poor QEMU Guest Performance
« Reply #5 on: April 26, 2020, 01:48:59 pm »
Do other CPU choices or changing the number of cores make any difference?

I run a homebrew QEMU and compile directly from source with -O3 -mcpu=power9. It's not super-fast running x86_64 code either, mind you. TCG is heaps better than interpreted code but even so it's still relatively simplistic.

deepblue

  • Newbie
  • *
  • Posts: 13
  • Karma: +3/-0
  • The only winning move is not to play...
    • View Profile
Re: Poor QEMU Guest Performance
« Reply #6 on: April 26, 2020, 02:52:42 pm »
The only other option I have used where I have seen a difference is qemu64, and that only tells RouterOS that it has moved from a VM to an emulated OS. I do have a huge list of Intel CPU types, but I have not seen any differences when using them.