public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server] qcow2: increase cache-size to 1GB
Date: Wed, 13 Aug 2025 16:25:19 +0200	[thread overview]
Message-ID: <1755094937.hut7e2rxef.astroid@yuna.none> (raw)
In-Reply-To: <mailman.52.1755092836.385.pve-devel@lists.proxmox.com>

On August 13, 2025 3:46 pm, Alexandre Derumier via pve-devel wrote:
>Currently, the qcow2 maximum cache-size is 32MB, enough to handle metadatas
>for a 256GB images with 65k cluster size.
>
>if cache-size is not big enough, performance are really bad
>
>This patch increase cache to 1GB, enough to handle 8TB image
>
>with default 32MB cache
>fio benchmark 4k randread/write:
>
>256GB image : 32MB cache : 40000 iops
>1TB image: 32MB cache: 2500 iops
>8TB image: 32MB cache: 2500 iops
>1TB image: 1G cache: 40000 iops
>8TB image: 1G cache: 40000 iops
>
>the cache-size value is a maximum value, memory is not reserved at vm start.
>Also, the metadatas not used are removed from the cache after 10min by defa=
>ult.
>
>https://gitlab.com/qemu-project/qemu/-/blob/master/docs/qcow2-cache.txt
>Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
>---
> src/PVE/QemuServer/Blockdev.pm                              | 3 +++
> src/test/cfg2cmd/bootorder-empty.conf.cmd                   | 6 +++---
> src/test/cfg2cmd/bootorder-legacy.conf.cmd                  | 6 +++---
> src/test/cfg2cmd/bootorder.conf.cmd                         | 6 +++---
> .../cfg2cmd/cputype-icelake-client-deprecation.conf.cmd     | 2 +-
> src/test/cfg2cmd/ide.conf.cmd                               | 2 +-
> src/test/cfg2cmd/q35-ide.conf.cmd                           | 2 +-
> src/test/cfg2cmd/q35-linux-hostpci-mapping.conf.cmd         | 2 +-
> src/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd   | 2 +-
> src/test/cfg2cmd/q35-linux-hostpci-template.conf.cmd        | 2 +-
> src/test/cfg2cmd/q35-linux-hostpci-x-pci-overrides.conf.cmd | 2 +-
> src/test/cfg2cmd/q35-linux-hostpci.conf.cmd                 | 2 +-
> src/test/cfg2cmd/q35-simple.conf.cmd                        | 2 +-
> src/test/cfg2cmd/seabios_serial.conf.cmd                    | 2 +-
> src/test/cfg2cmd/simple-backingchain.conf.cmd               | 4 ++--
> src/test/cfg2cmd/simple-virtio-blk.conf.cmd                 | 2 +-
> src/test/cfg2cmd/simple1-template.conf.cmd                  | 4 ++--
> src/test/cfg2cmd/simple1.conf.cmd                           | 2 +-
> src/test/run_qemu_img_convert_tests.pl                      | 6 +++---
> 19 files changed, 31 insertions(+), 28 deletions(-)
>
>diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm
>index f5798cbf..895f1a6a 100644
>--- a/src/PVE/QemuServer/Blockdev.pm
>+++ b/src/PVE/QemuServer/Blockdev.pm
>@@ -381,6 +381,9 @@ my sub generate_format_blockdev {
>         $blockdev->{'discard-no-unref'} =3D JSON::true if $format eq 'qcow=
>2';
>     }
>=20
>+    #increase qcow2 maximum cache size to 1GB memory, enough to handle 8TB=
> disk image with 64k clusters.
>+    $blockdev->{'cache-size'} =3D 1073741824 if $format eq 'qcow2';
>+
>     return $blockdev;
> }

have you benchmarked this? if so, did you compare it with using the
smaller cache-entry variant described in the file you linked:

https://gitlab.com/qemu-project/qemu/-/blob/master/docs/qcow2-cache.txt#L159

we also know the image size here, so we could use a capped, derived value?

what if the disk is resized? what about image files with bigger
clusters?


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2025-08-13 14:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13 13:46 Alexandre Derumier via pve-devel
2025-08-13 14:25 ` Fabian Grünbichler [this message]
2025-08-14 11:10   ` DERUMIER, Alexandre via pve-devel
2025-08-14 14:14     ` DERUMIER, Alexandre via pve-devel
2025-10-02  9:39     ` Fiona Ebner
2025-10-03  8:20       ` Fiona Ebner
2025-10-03 14:05       ` DERUMIER, Alexandre via pve-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1755094937.hut7e2rxef.astroid@yuna.none \
    --to=f.gruenbichler@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal