Linux – KVM – very slow disk io

T-Bash asked:

The I/O performance of my new server is pretty low. I Googled and tried everything I can imagine. First of all, here are the Hardware Components:

  • AMD Opteron(tm) Processor 6344
  • 4x Seagate ST3000VX000

Its currently running on a software RAID5.

Throughput from the host machine:

# dd if=/dev/zero of=testfile bs=64k count=16k conv=fdatasync
16384+0 records in
16384+0 records out
1073741824 bytes (1.1 GB) copied, 4.44095 s, 242 MB/s

Current throughput on the guest system:

# dd if=/dev/zero of=testfile bs=64k count=16k conv=fdatasync
16384+0 records in
16384+0 records out
1073741824 bytes (1.1 GB) copied, 94.8643 s, 11.3 MB/s

I’m using a self-compiled QEMU + LIBVIRT, plus a self compiled Linux kernel (3.10.32-lns-opteron-kvmhost). I can provide parts out of the kernel configuration.

  • Linux Kernel (HOST): 3.10.32-lns-opteron-kvmhost
  • Linux Kernel (GUEST): 3.10.2-lns-opteron-kvmguest
  • QEMU Version: 2.0.0
  • Libvirt Version: 1.2.4

I’m running both kernels on another system (same processor, but other hdds), which is running with full I/O performance.

I did not install the other system, so I can’t reliably reproduce the problem.

HDD Configuration of the guest:

<disk type='block' device='disk'>
  <driver name='qemu' type='raw' cache='none' io='threads'/>
  <source dev='/dev/vmstore/guest-data'/>
  <target dev='vda' bus='virtio'/>
</disk>

As you can see I’m using LVM.

I don’t have any performance issues with the CPU / Memory – only with the disk I/O.

My answer:


The only obvious problem I see in your configuration is io='threads'. This is unlikely to provide better performance than io='native'.

Beyond that, I also don’t recommend compiling any of these components (kernel, libvirt, QEMU) yourself unless you already have a deep understanding of them. Better to use a well-tested and known working package from a Linux distribution which has optimized it for performance and stability. RHEL/CentOS and Fedora work fine. I can’t vouch for any other distribution.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.