From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id D2A041FF183 for ; Wed, 13 Aug 2025 16:24:17 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7BBE0378C9; Wed, 13 Aug 2025 16:25:55 +0200 (CEST) Date: Wed, 13 Aug 2025 16:25:19 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: In-Reply-To: MIME-Version: 1.0 User-Agent: astroid/0.17.0 (https://github.com/astroidmail/astroid) Message-Id: <1755094937.hut7e2rxef.astroid@yuna.none> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1755095090298 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.049 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [gitlab.com, blockdev.pm] Subject: Re: [pve-devel] [PATCH qemu-server] qcow2: increase cache-size to 1GB X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" 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 >--- > 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