LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   XP guest suddenly runs very slowly on KVM (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/xp-guest-suddenly-runs-very-slowly-on-kvm-900526/)

kheldar 09-01-2011 03:55 AM

XP guest suddenly runs very slowly on KVM
 
Hi!

I'm running Fedora 14 on the host and hosting an XP guest using KVM. Just recently, the guest has been crashing and windows running VERY slowly. It seems to be the OS that is slow, rather than applications, as once it's running the apps work until the guest crashes.

I'm running...

kernel.x86_64 2.6.35.14-95.fc14
libvirt.x86_64 0.8.3-10.fc14
qemu-common.x86_64 2:0.13.0-1.fc14
qemu-img.x86_64 2:0.13.0-1.fc14
qemu-kvm.x86_64 2:0.13.0-1.fc14
qemu-system-x86.x86_64 2:0.13.0-1.fc14

It seems that the latest update to the Kernel or QEmu may have started the problem.

My Centos and Fedora guest seem to be fine.

Any suggestions would be great. Thanks!

K.

dyasny 09-01-2011 05:36 AM

can you post the VM command line?
`ps -ef| grep qemu`

brak44 09-01-2011 06:25 AM

If you can run the Windows Task Manager => Processors and examine the CPU usage. What process is consuming the most?

jefro 09-01-2011 04:58 PM

I'd suspect the VM client OS but it could be hardware related to host.

kheldar 09-02-2011 12:58 PM

Hi,

The command is:

/usr/bin/qemu-kvm -S -M pc-0.13 -cpu core2duo,+xtpr,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,+ds -enable-kvm -m 512 -smp 2,sockets=2,cores=1,threads=1 -name xp1 -uuid 786f357f-c0d0-ebd9-80b6-a2fac40b7468 -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/xp1.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=localtime -boot c -drive file=/var/lib/libvirt/images/xp1.img,if=none,id=drive-ide0-0-0,boot=on,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -drive file=/mnt/tmp/virtio-win-0.1-mm34.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:dd:00:ae,bus=pci.0,addr=0x6 -net tap,fd=44,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 0.0.0.0:7,password -vga std -device AC97,id=sound0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

I can't see any processes in the task manager I'm not expecting, but the system idle process takes quite a lot of cpu.

Once the system finishes booting and loading, it's usually ok for a while, but try and interact, and it takes minutes to respond to a click sometimes.

Grrr!

PTrenholme 09-02-2011 01:59 PM

If you use this command: ps -ef | grep qemu | sed '/ -/([^ ]/)/\n\t-\1/g' the output is somewhat easier to follow. For your qemu, it looks like this:
Code:

/usr/bin/qemu-kvm
        -S
        -M pc-0.13
        -cpu core2duo,+xtpr,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,+ds
        -enable-kvm
        -m 512
        -smp 2,sockets=2,cores=1,threads=1
        -name xp1
        -uuid 786f357f-c0d0-ebd9-80b6-a2fac40b7468
        -nodefconfig
        -nodefaults
        -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/xp1.monitor,server,nowait
        -mon chardev=monitor,mode=readline
        -rtc base=localtime
        -boot c
        -drive file=/var/lib/libvirt/images/xp1.img,if=none,id=drive-ide0-0-0,boot=on,format=raw
        -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0
        -drive file=/mnt/tmp/virtio-win-0.1-mm34.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw
        -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0
        -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:dd:00:ae,bus=pci.0,addr=0x6
        -net tap,fd=44,vlan=0,name=hostnet0
        -chardev pty,id=serial0
        -device isa-serial,chardev=serial0
        -usb
        -device usb-tablet,id=input0
        -vnc 0.0.0.0:7,password
        -vga std
        -device AC97,id=sound0,bus=pci.0,addr=0x4
        -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

Have you tried increasing your virtual memory? 512 seems somewhat small for a XP system.

kheldar 09-02-2011 04:54 PM

I've upped the memory to 2gb, all of which appears to be used by "top".

There is a massive discrepancy between the cpu usage on the guest and the host. Top reports the host hardly doing anything, while task manager reports the cpu being flat out.

jefro 09-02-2011 09:06 PM

Give it more cores.

kheldar 09-03-2011 06:05 AM

I've upped it from 1 to 2 cores (out of 4 on the host) and it doesn't make any difference.

jefro 09-03-2011 03:03 PM

I doubt qemu really can use more than one core yet. It used to only use a single core no matter what you told it to do.

dyasny 09-03-2011 04:30 PM

jefro qemu-kvm can use up to 64 cores (and my numbers might be wrong for the newer builds).

where are the cd image and xp1.img located? how is that location mounted?

kheldar 09-04-2011 12:21 PM

They're both on a lvm logical volume, where the physical volume is a software Raid 1 partition, made of two PATA disks.

jefro 09-04-2011 01:22 PM

Then either they have an older version or some other setup problem. The client is not really using the hosts cores correctly. The only other issue would be some limit on that process that the host is imposing by some program. I forget the common way to limit processes.

I an rather confused as to how kvm (which uses qemu) to support real use of the host's cores since qemu can not.

dyasny 09-04-2011 02:15 PM

Quote:

Originally Posted by kheldar (Post 4461214)
They're both on a lvm logical volume, where the physical volume is a software Raid 1 partition, made of two PATA disks.

I meant the mount options for those disks. If you haven't yet, try using noatime and nodiratime and see what happens

dyasny 09-04-2011 02:17 PM

Quote:

Originally Posted by jefro (Post 4461269)
The client is not really using the hosts cores correctly.

how can you tell?

Quote:

The only other issue would be some limit on that process that the host is imposing by some program. I forget the common way to limit processes.
cgroups?

Quote:

I an rather confused as to how kvm (which uses qemu) to support real use of the host's cores since qemu can not.
this is what kvm is for actually, not-so-strictly speaking.
every cpu a VM has is a thread running on the hosts' cpu, again, not-so-strictly speaking


All times are GMT -5. The time now is 10:21 PM.