From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 45FEB70AEF; Tue, 8 Jun 2021 09:58:29 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 38F2E1873B; Tue, 8 Jun 2021 09:58:29 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 617AA1872D; Tue, 8 Jun 2021 09:58:27 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 302CE417E3; Tue, 8 Jun 2021 09:58:21 +0200 (CEST) Date: Tue, 8 Jun 2021 09:58:18 +0200 From: Wolfgang Bumiller To: Stefan Reiter Cc: pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com Message-ID: <20210608075818.x5qs3ynw5mwp6ng3@wobu-vie.proxmox.com> References: <20210607153532.2522267-1-s.reiter@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210607153532.2522267-1-s.reiter@proxmox.com> User-Agent: NeoMutt/20180716 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.557 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_ASCII_DIVIDERS 0.8 Spam that uses ascii formatting tricks KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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. [restore.rs, mount.rs, backup.rs, proxmox.com, datastore.rs, lib.rs, tools.rs] Subject: [pve-devel] applied: [PATCH v2 0/9] Improve live-restore speed and replace AsyncIndexReader 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: , X-List-Received-Date: Tue, 08 Jun 2021 07:58:29 -0000 applied series On Mon, Jun 07, 2021 at 05:35:23PM +0200, Stefan Reiter wrote: > This series is the third/fourth attempt[0] at substantially improving > live-restore performance. This time, a fully async- and concurrency safe LRU > cache is implemented, and a new CachedChunkReader is used to provide lock-free > reading from a remote chunk source. The big performance improvements come from > removing the global Mutex synchronising all read_image_at requests in the QEMU > library and the shared LRU cache. > > The idea of using 'mmap' to alleviate memory pressure was dropped in favor of > using a shared cache between drives. This provides about the same performance > improvement in typical live-restore scenarios, but with a fixed memory > requirement, independant of drives. Adding 'mmap' caching is doable, but the > Rust code really doesn't look very nice with it, and I think it's not necessary > in this version... > > Anyway, I figured out how to better benchmark the changes too, and can now > reproduce the performance gains very reliably. Below is a (gnu)plot of running > 40 live-restores of a Windows 10 VM with a single 32GB disk, first with the > currently shipping libproxmox-backup-qemu0 (A) and then with the patched one > from this series (B). Testing was done with QEMU 6.0. > > > v2: > * address Wolfgang's review comments, mostly style stuff > > > seconds > 240 +-----------------------------------------------------------------------+ > | + + + + + + A + | > 230 |-+ A A A +-| > | A A A AA A A A A | > 220 |-+ A AA A A +-| > | A A A A A A AA A A | > 210 |-+ A A A A A A A-| > | A | > 200 |-+ A +-| > | | > 190 |-+ +-| > | | > 180 |-A +-| > | | > 170 |-+ +-| > | B B B | > 160 |-B B B B B B B +-| > | B B B B B | > 150 |-+ BB B BB B B B B B B B B-| > | B + B + + B + B B + B + B B + B | > 140 +-----------------------------------------------------------------------+ > 0 5 10 15 20 25 30 35 40 > iteration > 1.0.3-1 A > patched B > > > [0] see: https://lists.proxmox.com/pipermail/pbs-devel/2021-April/002932.html > > > proxmox-backup: Stefan Reiter (7): > tools/BroadcastFuture: add testcase for better understanding > tools: add AsyncLruCache as a wrapper around sync LruCache > backup: add CachedChunkReader utilizing AsyncLruCache > backup: add AsyncRead/Seek to CachedChunkReader > replace AsyncIndexReader with SeekableCachedChunkReader > backup: remove AsyncIndexReader > tools/lru_cache: make minimum capacity 1 > > src/api2/admin/datastore.rs | 4 +- > src/backup.rs | 4 +- > src/backup/async_index_reader.rs | 215 ------------------------- > src/backup/cached_chunk_reader.rs | 189 ++++++++++++++++++++++ > src/bin/proxmox_backup_client/mount.rs | 4 +- > src/tools.rs | 1 + > src/tools/async_lru_cache.rs | 135 ++++++++++++++++ > src/tools/broadcast_future.rs | 11 ++ > src/tools/lru_cache.rs | 1 + > 9 files changed, 343 insertions(+), 221 deletions(-) > delete mode 100644 src/backup/async_index_reader.rs > create mode 100644 src/backup/cached_chunk_reader.rs > create mode 100644 src/tools/async_lru_cache.rs > > proxmox-backup-qemu: Stefan Reiter (2): > add shared_cache module > access: use CachedChunkReader > > src/lib.rs | 7 ++++++- > src/restore.rs | 30 ++++++++---------------------- > src/shared_cache.rs | 37 +++++++++++++++++++++++++++++++++++++ > 3 files changed, 51 insertions(+), 23 deletions(-) > create mode 100644 src/shared_cache.rs > > -- > 2.30.2