Windows + without writeback disk cache + cloudmin = slow

7 posts / 0 new
Last post
#1 Tue, 07/03/2012 - 05:36
philippeguru

Windows + without writeback disk cache + cloudmin = slow

Hello all,

I recently migrated my windows machines to a dedicated cloudmin server running CentOs as host.

I found that my windowsxp and windows 2003 machines were terribly slow/lagged. Interestingly my windows 2008 machines were running fine.

After days of troubleshooting, I did a lookup on the running processes of the qemu-kvm and found out that cloudmin, when launching the vm, did not include the necessary parameters to enable the writeback disk cache.

As a quick solution, what I did was I manually launched my vm.

(For example:

/usr/libexec/qemu-kvm -name WindowsXPMachine.prj -m 3072 -drive index=0,media=disk,file=/virtualmachines/WindowsXPMachine.img,cache=writeback,if=ide -boot c -net tap,vlan=0,script=/virtualmachines/WindowsXPMachine-eth0.sh -net nic,vlan=0,macaddr=00:07:e9:a0:f0:19,model=rtl8139 -vnc :19 -usbdevice tablet -monitor tcp:127.0.0.1:40010,server,nowait -smp 4

)

Then I used the option in cloudmin to "refresh the status of the machine", and it came up as alive machine.

And that solved the problem. The windows xp machine is now lightening fast!

Now my question is, how can I enable writeback cache in the cloudmin? Or if there is no such feature, where can I amend the command line arguments/launching script that is used by Cloudmin while launching a vm?

This way I can retain the disk cache feature by simply using the 'Startup System' link, rather than manually launching the machine from console.

Cheers, P

Tue, 07/03/2012 - 13:44
JamieCameron

I looked into this writeback cache option, and it seems that it may be risky to use on a production VM as there is no guarantee that data written to the disk by the VM is actually written on the host. See http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=...

That said, you can enable it manually as follows :

  1. SSH into the Cloudmin master system as root
  2. Get the VM's unique ID with the command cloudmin list-systems --host WindowsXPMachine.prj --id-only
  3. Edit the file /etc/webmin/servers/XXX.serv , where XXX is the ID from the previous step
  4. Find the line starting with kvm_drives and add cache=writeback in the correct place.

''

Tue, 02/26/2013 - 02:18 (Reply to #2)
sfatula

While it is true that writeback is somewhat risky, almost identical performance gains can be had by cache=none. As supporting evidence, here is a comparison:

http://www.ilsistemista.net/index.php/virtualization/11-kvm-io-slowness-...

This would provide the benefit, with no risk as far as I understand. Can this be made an option to Cloudmin when creating or modifying a machine? I believe the default is writethrough which is pretty slow in most cases, at least for me.

Tue, 02/26/2013 - 13:39 (Reply to #3)
JamieCameron

Allowing the cache type to be customized in Cloudmin is a reasonable request. I will look into this for the next release..

''

Tue, 02/26/2013 - 13:41 (Reply to #4)
sfatula

Just an FYI, on my virtual machine, I got 3x disk performance when changing to cache=none. I updated /etc/webmin/servers serv file for the VM.

Fri, 03/01/2013 - 20:06 (Reply to #5)
JamieCameron

I've just finished implementing a feature for the next Cloudmin release - you will be able to configure on a per-disk basis the cache mode used for KVM instances. You will also be able to set the default for new VMs.

This will go into Cloudmin 6.9.

''

Wed, 07/04/2012 - 10:22
philippeguru

Dear Jamie,

All worked like a charm.

Thanks P

Topic locked