QEMU 2.5 - Setting L2 cache size drive option

raytracy

Member
Mar 31, 2016
19
0
6
54
I have same issue, is there any one know where can we specify the l2-cache-size drive-options?
 

wolfgang

Proxmox Staff Member
Staff member
Oct 1, 2014
5,123
339
103
Hi,

no not direct, the only workaround is to use args in the config.
But with args you must manage images self.
 

raytracy

Member
Mar 31, 2016
19
0
6
54
Thanks for reply, wolfgang:

It is no problem to manage it manually, but I don't know what is the correct parameter syntax? I have try to append following to vm conf like:

virtio0: VMDisk:vm-103-disk-1,cache=writeback,size=32G,l2-cache-size=4194304

but the pve manager refused to start this VM?
 
Last edited:

wolfgang

Proxmox Staff Member
Staff member
Oct 1, 2014
5,123
339
103

Humbug

Member
Nov 14, 2012
30
1
8
Is there any workaround? E.g. can i create the qcow2 image manually, so i don't need to add the parameter later?
And is there any plan to integrate this parameter as a Proxmox PVE feature in future?
 

fabian

Proxmox Staff Member
Staff member
Jan 7, 2016
3,581
552
118
Is there any workaround? E.g. can i create the qcow2 image manually, so i don't need to add the parameter later?
And is there any plan to integrate this parameter as a Proxmox PVE feature in future?
please file a bug at https://bugzilla.proxmox.com if you want to see this supported
 

MikeQ

New Member
Feb 1, 2019
4
1
3
37
Hi guys!

I found the way how to append l2-cache-size parameter to VM-start command line.

h***s://wiki.autosys.tk/doku.php?id=proxmox:improving_the_performance_of_the_qcow2_format

You need open file /usr/share/perl5/PVE/QemuServer.pm, then find line:

$opts .= ",format=$format" if $format && !$drive->{format};

(in proxmox 5.2 line number is 1770) and after this line add this piece of code:

if ($format eq "qcow2") {
$opts .= ",l2-cache-size=16M";
}

save file and reboot proxmox node (changes to QemuServer.pm are not applying without reboot). This piece of code will append l2-cache-size=16M parameter if disk format equals to qcow2 on vm start. This modification allows to manage qcow2 disk with proxmox and boot with it. Disadvantage is that cache size is "hardcoded" and settings applie to every qcow disk on modified host.
 
Last edited:
  • Like
Reactions: Humbug

MikeQ

New Member
Feb 1, 2019
4
1
3
37
Hi, Humburg!
Please test performance with and without this workaround and report!
 

MikeQ

New Member
Feb 1, 2019
4
1
3
37
Well. I tested IO with fio on Windows 2008R2 with 32Gb qcow2 drive.
I did not get performance boost with enabled l2-cache-size in my environment.

fio.exe --name=baseline --rw=randwrite --direct=1 --size=1g --iodepth=32 --blocksize=4096 --thread --ioengine=windowsaio --filename=c:\temp\fiotest --name=hddBaseline --stonewall

without qcow2 l2-cache-size=16M
IOPS=15.4k
IOPS=13.4k
IOPS=14.1k
IOPS=18.2k
IOPS=14.1k

with qcow2 l2-cache-size=16M
IOPS=12.3k
IOPS=13.0k
IOPS=16.5k
IOPS=12.0k
IOPS=14.8k

with l2-cache-size=2097152,l2-cache-entry-size=4096,
IOPS=18.4k
IOPS=10.8k
IOPS=12.6k
IOPS=14.2k
IOPS=13.3k

with l2-cache-size=2097152,l2-cache-entry-size=2048
IOPS=14.3k
IOPS=14.3k
IOPS=16.5k
IOPS=13.8k
IOPS=13.2k
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!