QEMU 2.5 - Setting L2 cache size drive option

I have same issue, is there any one know where can we specify the l2-cache-size drive-options?
 
Hi,

no not direct, the only workaround is to use args in the config.
But with args you must manage images self.
 
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:
You get me wrong. It is not possible to add the parameter directly to the disk.
You have to write the whole drive manually and add it with the args parameter.
See
https://pve.proxmox.com/pve-docs/pv...ng_qm_strong_qemu_kvm_virtual_machine_manager
qm set --args

But the backside is no storage operation will work anymore because Proxmox VE can't handle this drive.
Also, you can't boot anymore from this device.
 
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?
 
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
 
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
Hi, Humburg!
Please test performance with and without this workaround and report!
 
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, Proxmox Backup Server, 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 yours easily in our online shop.

Buy now!