1

I've got a Debian 10.6 Host, with a Debian 10.6 guest. KVM/Qemu/libvirt. The host has a software RAID 10 array with 6 mechanical disks. LVM is on top of the RAID array. One LV is passed into the guest using:

<disk type='block' device='disk'>
  <driver name='qemu' type='raw' cache='none' io='native'/>
  <source dev='/dev/raid10/lv0'/>
  <target dev='vdb' bus='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</disk>

The host writes to the logical volume at about 720 MB/s:

dd of=diskbench if=/dev/zero bs=30000000 count=2000
(60 GB, 56 GiB) copied, 82.7758 s, 725 MB/s
(60 GB, 56 GiB) copied, 82.5263 s, 727 MB/s
(60 GB, 56 GiB) copied, 83.8701 s, 715 MB/s
(45 GB, 42 GiB) copied, 58.9086 s, 772 MB/s

Inside the guest though, the same test runs much slower:

dd of=diskbench if=/dev/zero bs=30000000 count=2000
(60 GB, 56 GiB) copied, 254.088 s, 236 MB/s
(60 GB, 56 GiB) copied, 245.407 s, 244 MB/s
(60 GB, 56 GiB) copied, 242.558 s, 247 MB/s

This system is not in production yet and not under load. What can I check for to improve write performance?

Nick
  • 4,503
  • 29
  • 69
  • 97
  • 1
    One note, dd isn't a proper way to measure disk performance. `fio` is one of correct methods. Of course, you need to learn some theory to use it... // Being said that, I must admit, I am too disappointed with disk performance in Qemu-based virtualization and would be happy to know how to improve that at least to the performance level that Hyper-V shows on exactly same hardware. We performed many tests with fio and CrystalDiskMark https://serverfault.com/questions/1002138/bad-linux-storage-performance-in-comparison-with-windows-on-the-same-machine ; nodoby had any suggestion on how to improve. – Nikita Kipriyanov Jan 15 '21 at 16:45

1 Answers1

2

Don't use dd as a tool for measuring performance. The command line arguments given to dd in your example allow the host OS to cache the writes in RAM. So the results here are likely skewed by the amount of RAM available for caching in the host OS vs the guest OS. fio is a much more relevant tool for benchmarking.

DanielB
  • 1,618
  • 7
  • 7