Skip to content

Instantly share code, notes, and snippets.

@sar
Created January 15, 2021 18:54
Show Gist options
  • Save sar/4cce150ba569bd487c5d23f144f4e040 to your computer and use it in GitHub Desktop.
Save sar/4cce150ba569bd487c5d23f144f4e040 to your computer and use it in GitHub Desktop.
Improve libvirsh kvm performance by tweaking CPU, GPU, and Disk

KVM (Virsh) Performance Tweaking

VirtIO GPU

    <video>
      <model type='virtio' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>

Host CPU Model

  <vcpu placement='static'>16</vcpu>
  <cpu mode='host-passthrough' check='partial'>
    <topology sockets='2' cores='4' threads='2'/>
  </cpu>

Disk IO Native or Threads

    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/sdX'/>
      <target dev='vdX' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </disk>
@sar
Copy link
Author

sar commented Feb 4, 2021

Use virtio graphics acceleration instead of QXL:

    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment