You are not logged in.

#1 2010-12-01 16:12:46

xyon
Member
Registered: 2007-09-17
Posts: 23

KVM random crawls/slow-downs [SOLVED]

I am having trouble with KVM guests coming to a crawl, especially during heavy disk activity (ie, package installs, formatting partition, etc). Sometimes I will see kernel errors stating "unable to commit journal" or something similar on the console, even if the guest is just idle.

The guests range from CentOS, the BSD's, Debian, and a host of other *nix-based Operating Systems. I have noticed this behavior on multiple hosts (Intel Core2Duo, and Athlon Phenom II X4). I am still pretty new to the whole KVM-thing, I come from a Xen background.  Here is some pertinent info:

$ egrep "(vmx|svm)" /proc/cpuinfo|wc -l
2

$ egrep "(vmx|svm)" /proc/cpuinfo 
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm dts tpr_shadow
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm dts tpr_shadow

$ uname -r
2.6.36-ARCH

$ free -m
             total       used       free     shared    buffers     cached
Mem:          2008       1985         22          0         78        121
-/+ buffers/cache:       1785        222
Swap:         3906        360       3545

$ qemu-img create -f qcow /KVM/images/linux01.img 10G

$ sudo qemu -enable-kvm /KVM/images/linux01.img -cdrom /iso/CentOS-5.5-i386-bin-1of7.iso -daemonize -net nic,model=e1000 -net user,hostfwd=tcp:127.0.0.1:722-:22 -m 512M

OR

$ qemu-img create -f qcow /KVM/images/distro-test.img 20G

$ qemu-system-x86_64 -enable-kvm /KVM/images/distro-test.img -cdrom /iso/CentOS-5.5-x86_64-bin-1of8.iso -daemonize -net nic,model=e1000 -m 512M

Either of the above installs will take ages to complete (especially during the format), and sometimes just completely lock up (or at least appear to). Once the OS is installed it will work fine for a while, but as soon as I do a "yum update", untar ports.tar.gz (for BSD), or anything disk-related, it will randomly stop throughout the process and hang until continuing on.

Last edited by xyon (2010-12-01 19:54:02)

Offline

#2 2010-12-01 17:23:47

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: KVM random crawls/slow-downs [SOLVED]

Don't know if its related to your problem, but with qemu 0.11 the standard disk-caching method changed from "writeback" to "writethrough".
So any write-access can result in huge slowdowns, especially with qcow-Images. Look at the man-page for more information on this.
You have to change the cache method with the drive option, e.g.

... -drive file=distro-test.img,cache=writeback ...

Offline

#3 2010-12-01 19:52:33

xyon
Member
Registered: 2007-09-17
Posts: 23

Re: KVM random crawls/slow-downs [SOLVED]

Wow, using "writeback" did it, thanks a ton metzengerstein. Now I feel more confident decomissioning my Xen box and running my VM's under KVM on my workstation.

The 'drive' section of the man page is informative, thank you for the reference.

Offline

Board footer

Powered by FluxBB