Submitted by pban02 on Sun, 11/11/2012 - 19:59 Pro Licensee
How should I go about changing command line arguments to KVM? Things like cache=none or cache=writethrough.
I noticed that the swap uses cache=off : shouldn't it be cache=none (Ubuntu 12.04)?
Also how can I set cache=none or cache=writeback for the main LV which is mounted as root on the VM.
And yes I know cache=writeback may not be a good idea, but my KVMs have such slow IO Performance (only about 1/3 of the host) that I am desperate for some improvement.
The host is a quad core i7 with 32GB memory and software Raid-1 (2 x 3 TB) running Ubuntu 12.04. The VMs are also running Ubuntu 12.04.
Status:
Active
Comments
Submitted by JamieCameron on Sun, 11/11/2012 - 23:02 Comment #1
My impression is that cache=none is only for use when the underlying disk file is a device or partition.
Cache=off is best for swap, because it makes no sense to cache swap in RAM on the host system when it is explicitly meant to use disk.
That said, you can edit these settings in Cloudmin as follows :
cloudmin list-systems --host xyz --id-only
, where xyz is the full hostname of your VM./etc/webmin/servers
whose name starts with that ID.kvm_drives
and make whatever changes you want.Submitted by pban02 on Wed, 11/14/2012 - 12:08 Pro Licensee Comment #2
@Jamie: You are right and we are talking about the same thing.
I was trying to point out that option syntax on Ubuntu 12.04 according to the man pages is "cache=none" and there is no "cache=off" option.
So you may need to correct that in the next release for Debian / Ubuntu. There is also a bootup message about boot=on being deprecated that you may need to fix in the next release.
Submitted by JamieCameron on Wed, 11/14/2012 - 12:34 Comment #3
That's odd, as on my system the man page says the option is cache=off.
Which KVM version are you running there?
Submitted by pban02 on Wed, 11/14/2012 - 13:12 Pro Licensee Comment #4
I started off with Cloudmin's Ubuntu 12.04 image and did an
apt-get update and apt-get upgrade
Current Version:
qemu-common 1.0+noroms-0ubuntu14.2
qemu-kvm 1.0+noroms-0ubuntu14.2
qemu-utils 1.0+noroms-0ubuntu14.2
kvm-ipxe 1.0.0+git-3.55f6c88-0ubuntu1
Submitted by pban02 on Wed, 11/14/2012 - 13:13 Pro Licensee Comment #5
Exerpt from man kvm:
cache=cache
cache is "none", "writeback", "unsafe", "directsync" or
"writethrough" and controls how the host cache is used to
access block data.
Submitted by pban02 on Wed, 11/14/2012 - 13:33 Pro Licensee Comment #6
Here is the excerpt from kvm --help:
-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]
[,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]
[,cache=writethrough|writeback|none|directsync|unsafe][,format=f]
[,serial=s][,addr=A][,id=name][,aio=threads|native]
[,readonly=on|off]
I just upgraded to the latest versions of KVM.
Do you think
aio=native
will make a difference for performance? One of the blogs was recommending that.
Submitted by JamieCameron on Wed, 11/14/2012 - 16:52 Comment #7
It looks like cache=off is still supported, and does the same thing as cache=none ... and some older versions of Qemu still require this. So I'm reluctant to change Cloudmin to use cache=none for now.
I'm not sure if aio=native will help, but you could try it out using the same method I suggested in comment #1.