]> git.proxmox.com Git - proxmox-backup.git/commit
backup/verify: improve speed by sorting chunks by inode
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 13 Apr 2021 14:35:36 +0000 (16:35 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Apr 2021 12:39:24 +0000 (14:39 +0200)
commit7f394c807bca3f451e77b6a1cf7de7c6e7df5f92
tree4f0e63e7b5c09dde3c7702934250c9b8c69ac68d
parent7afb98a9123f4ac4eb1842f253a42b7e85a9c653
backup/verify: improve speed by sorting chunks by inode

before reading the chunks from disk in the order of the index file,
stat them first and sort them by inode number.

this can have a very positive impact on read speed on spinning disks,
even with the additional stat'ing of the chunks.

memory footprint should be tolerable, for 1_000_000 chunks
we need about ~16MiB of memory (Vec of 64bit position + 64bit inode)
(assuming 4MiB Chunks, such an index would reference 4TiB of data)

two small benchmarks (single spinner, ext4) here showed an improvement from
~430 seconds to ~330 seconds for a 32GiB fixed index
and from
~160 seconds to ~120 seconds for a 10GiB dynamic index

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/backup/datastore.rs
src/backup/verify.rs