In a some previous posts, I found that we had discussed how increasing the L2 cache size can improve qcow2 disk performance. However, there wasn't a clear set of instructions explaining how to implement this change. Therefore, I decided to create a simple and straightforward guide to make the process easier to follow.
For this test, I first created a 2 TB qcow2 disk on top of an LVM volume, as my environment uses a SAN iSCSI LUN mapping. After benchmarking the disk, I observed that the performance was significantly lower than that of a raw disk, highlighting the overhead introduced by the qcow2 format.

Next, power off the VM and SSH into the Proxmox host that contains it. Locate the VM configuration file at:
Edit the configuration file and add the following line at the end. Replace l2-cache-size with the desired cache size and specify the path to your qcow2 disk file:
View attachment 98841
After applying the L2 cache size change and restarting the VM, the performance improved significantly. Benchmark results showed that the qcow2 disk now performs at a level comparable to a raw disk.

For this test, I first created a 2 TB qcow2 disk on top of an LVM volume, as my environment uses a SAN iSCSI LUN mapping. After benchmarking the disk, I observed that the performance was significantly lower than that of a raw disk, highlighting the overhead introduced by the qcow2 format.

Next, power off the VM and SSH into the Proxmox host that contains it. Locate the VM configuration file at:
Code:
/etc/pve/qemu-server/<VM_ID>.conf
Code:
args: -blockdev qcow2,node-name=qcow2-cache-override,l2-cache-size=268435456,file.driver=host_device,file.filename=/dev/LVM-LUN-01/vm-112-disk-0.qcow2
After applying the L2 cache size change and restarting the VM, the performance improved significantly. Benchmark results showed that the qcow2 disk now performs at a level comparable to a raw disk.
