QEMU 2.5 - Setting L2 cache size drive option

Discussion in 'Proxmox VE: Installation and configuration' started by hodo, Jun 22, 2016.

  1. hodo

    hodo New Member

    Joined:
    Jun 22, 2016
    Messages:
    28
    Likes Received:
    4
    Humbug, chrone and Lucio Magini like this.
  2. raytracy

    raytracy New Member

    Joined:
    Mar 31, 2016
    Messages:
    19
    Likes Received:
    0
    I have same issue, is there any one know where can we specify the l2-cache-size drive-options?
     
  3. wolfgang

    wolfgang Proxmox Staff Member
    Staff Member

    Joined:
    Oct 1, 2014
    Messages:
    4,763
    Likes Received:
    315
    Hi,

    no not direct, the only workaround is to use args in the config.
    But with args you must manage images self.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. raytracy

    raytracy New Member

    Joined:
    Mar 31, 2016
    Messages:
    19
    Likes Received:
    0
    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?
     
    #4 raytracy, Apr 13, 2018
    Last edited: Apr 13, 2018
  5. wolfgang

    wolfgang Proxmox Staff Member
    Staff Member

    Joined:
    Oct 1, 2014
    Messages:
    4,763
    Likes Received:
    315
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Humbug

    Humbug Member

    Joined:
    Nov 14, 2012
    Messages:
    30
    Likes Received:
    1
    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?
     
  7. fabian

    fabian Proxmox Staff Member
    Staff Member

    Joined:
    Jan 7, 2016
    Messages:
    3,299
    Likes Received:
    508
    please file a bug at https://bugzilla.proxmox.com if you want to see this supported
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Humbug

    Humbug Member

    Joined:
    Nov 14, 2012
    Messages:
    30
    Likes Received:
    1
  9. MikeQ

    MikeQ New Member

    Joined:
    Feb 1, 2019
    Messages:
    4
    Likes Received:
    1
    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.
     
    #9 MikeQ, Feb 1, 2019
    Last edited: Feb 2, 2019
    Humbug likes this.
  10. Humbug

    Humbug Member

    Joined:
    Nov 14, 2012
    Messages:
    30
    Likes Received:
    1
    Hi MikeQ, thanks a lot for sharing this workaround!
     
  11. MikeQ

    MikeQ New Member

    Joined:
    Feb 1, 2019
    Messages:
    4
    Likes Received:
    1
    Hi, Humburg!
    Please test performance with and without this workaround and report!
     
  12. MikeQ

    MikeQ New Member

    Joined:
    Feb 1, 2019
    Messages:
    4
    Likes Received:
    1
    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
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice