From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 5D3791FF0B2 for ; Tue, 08 Sep 2026 14:37:53 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id CBF5021538; Tue, 08 Sep 2026 14:37:49 +0200 (CEST) From: Markus Frank To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v1] {pbs-,vma-}restore: disable caching for LVM-thin Date: Tue, 8 Sep 2026 14:37:07 +0200 Message-ID: <20260908123727.285848-1-m.frank@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788871057256 X-SPAM-LEVEL: Spam detection results: 0 DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: CPQXKEHWYXCTK5H2V7KRLK67XMQ754R3 X-Message-ID-Hash: CPQXKEHWYXCTK5H2V7KRLK67XMQ754R3 X-MailFrom: m.frank@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Mitigate performance issues with LVM-thin by disabling the page cache when restoring to LVM-thin storage. This reduces the time taken for a restore to LVM-thin by approximately half. A user has reported that their iSCSI LUNs cannot handle the number of requests generated by 4k block writes when using pbs-restore with caching enabled. Signed-off-by: Markus Frank --- src/PVE/QemuServer.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index 149f17be..3e3d9bfb 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -7092,7 +7092,9 @@ sub restore_proxmox_backup_archive { # TODO: extending this needs a separate rationale, the amplification # avoided here is specific to the volblock layout my $target_scfg = PVE::Storage::storage_config($storecfg, $d->{storeid}); - push @$pbs_restore_cmd, '--no-cache' if $target_scfg->{type} eq 'zfspool'; + if ($target_scfg->{type} eq 'zfspool' || $target_scfg->{type} eq 'lvmthin') { + push @$pbs_restore_cmd, '--no-cache'; + } my $dbg_cmdstring = PVE::Tools::cmd2string($pbs_restore_cmd); print "restore proxmox backup image: $dbg_cmdstring\n"; @@ -7674,7 +7676,10 @@ sub restore_vma_archive { # TODO: extending this needs a separate rationale, the amplification # avoided here is specific to the volblock layout - my $cache_none = $scfg->{type} eq 'zfspool' ? ':cache=none' : ''; + my $cache_none = ''; + if ($scfg->{type} eq 'zfspool' || $scfg->{type} eq 'lvmthin') { + $cache_none = ':cache=none'; + } print $fifofh "${map_opts}format=$d->{format}${cache_none}:${write_zeros}:$d->{devname}=$path\n"; -- 2.47.3