Hello,
I'm having a critical issue with KVM/QEMU which is severely impacting one of my projects and I don't know where to put my hands.
I've set up a brand new physical server configured with a 2 x Intel Xeon E5504 (4c/4t) and 16GB of RAM. I have installed Ubuntu Server 14.04.1 (linux-image 3.13.0-44-generic) along with KVM 2.0.0+dfsg-2ubuntu1.10, QEMU 1.22, libvirt 1.2.2.
I need to set up several VM instances that have to be fired up on demand when I need to analyze big data, with a timeout of 2 minutes, after that I kill the analysis (they should end way before that though). I decided to set up 8 VMs (one per thread) with 1GB of ram assigned each one, and all of them run Windows XP. All the VMs use the qcow2 format.
I installed the first VM and took a snapshot of it (virsh snapshot-create-as), then I replicated the same snapshot on all the other instances.
The first time I run all the VMs everything run smoothly, the VMs fire up and shut down perfectly.
However, after a while I turn them on and off, all the VMs start being slow as hell, like if KVM is not doing anymore hardware emulation and QEMU falls back in software emulation. The consequence is that all the analysis hit the critical timeout and got killed
Even when all the VMs run at the same time the two CPUs are not 100% loaded and the RAM itself is only 56% busy, the swap file is totaly free.
I tried tuning up the I/O scheduler deadline by changing the parameters:
read_expire at 80
write_expire at 1500
fifo batch at 16
front merges at 1
write starved at 6
and I set up the VMs with io=native disk configuration.
This last round of tuning improved the situation, yet it doesn't fix it as I've just raised the amount of time the VMs can run without any issue before reaching the fatal slowdown (which now arrives after several hours).
Could somebody of you guys give me a help in trying to figure out why this behavior is happening?
I don't know anymore where to put my hands on.
Many thanks in advance!
Kind regards