From: Enrico Plantulli <plantulli@gmail.com>
To: pbs-devel@lists.proxmox.com
Cc: Enrico Plantulli <plantulli@gmail.com>
Subject: [PATCH v2 proxmox proxmox-backup 0/3] datastore: gc: defer and batch chunk atime updates
Date: Tue, 11 Aug 2026 11:37:18 +0200 [thread overview]
Message-ID: <20260811093722.735290-1-plantulli@gmail.com> (raw)
In-Reply-To: <20260810050201.347124-1-plantulli@gmail.com>
Hi,
this is v2 of the chunk metadata prefetch series, reworked along the
lines suggested in the review of v1: instead of one whole-store
readdir pass before phase 1, the chunk atime updates themselves are
now deferred into a bounded list and flushed sorted by digest, opening
and iterating each chunk directory right before its chunks are
touched, with the utimensat() calls going through the open directory
file descriptor.
Changes since v1:
* dropped the whole-store prefetch pass and the
prefetch_chunk_metadata() helper entirely;
* added deferred, batched atime updates behind the same opt-in
gc-chunk-metadata-prefetch tuning option (kept opt-in as requested:
backends that do not prefetch on readdir, e.g. network attached
storage, may regress);
* added a separate gc-prefetch-batch-size tuning option (default
1048576, range 1024 - 16M) as an independent knob, as suggested, to
make benchmarking on different backends easy;
* the batch is used for filesystem backed datastores only; S3 keeps
the immediate path, since its in-use markers need per-chunk
handling anyway;
* a chunk found missing at flush time is handled as before (touch the
.bad companions, warn), but the warning can only name the digest,
not the referencing index file - noted in patch 2;
* GUI patch now covers both options.
Why the rework was needed, empirically: I ran the v1 one-pass version
on the 72M chunk production datastore (A in the v1 thread). The pass
itself was fast (81.8M directory entries in 59m32s), but the warmed
metadata did not survive until a phase 1 that runs for hours reached
it: the GC worker was observed blocked in
zio_wait <- dbuf_read <- zap_get_leaf_byblk (and dnode_hold_impl),
re-reading from disk the very blocks the pass had loaded hours
earlier, with the ARC sitting at its adaptive target far below
c_max. External re-walks recovered the rate only modestly (~+30%).
Warming right before use removes that window entirely, which is what
this v2 does.
The batch size bound also controls the readdir amplification: a flush
of N sorted entries spans up to min(N, 65536) directories, so about
N/65536 chunks are served per directory read. The default of 1M gives
~16 used chunks per directory read on a full store; benchmarking
larger values is exactly what the separate option is for.
Testing: compile-tested (cargo build, clippy with no new warnings,
fmt, cargo test) against current master of both repositories. I have
not yet run this exact v2 end-to-end in production; I will follow up
with figures from datastore A and B once it has. NAS-backed figures
would be very welcome from anyone with such a setup, as discussed.
CLA: signed and sent to office@proxmox.com on Aug 10; office has been
in touch.
proxmox:
Enrico Plantulli (1):
pbs-api-types: add gc chunk metadata prefetch tuning options
pbs-api-types/src/datastore.rs | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
proxmox-backup:
Enrico Plantulli (2):
datastore: gc: optionally defer and batch chunk atime updates
ui: tuning: add GC chunk metadata prefetch options
docs/storage.rst | 20 ++++++++
pbs-datastore/src/chunk_store.rs | 102 +++++++++++++++++++++++++++++++++++++++
pbs-datastore/src/datastore.rs | 93 +++++++++++++++++++++++++++++++++-----
www/Utils.js | 12 +++++
www/datastore/OptionView.js | 27 +++++++++++
5 files changed, 245 insertions(+), 9 deletions(-)
Thanks,
Enrico Plantulli
next prev parent reply other threads:[~2026-08-11 9:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 5:01 [PATCH proxmox proxmox-backup 0/3] datastore: gc: prefetch chunk metadata before phase 1 Enrico Plantulli
2026-08-10 5:01 ` [PATCH proxmox 1/3] pbs-api-types: add gc chunk metadata prefetch tuning option Enrico Plantulli
2026-08-10 5:01 ` [PATCH proxmox-backup 2/3] datastore: gc: optionally prefetch chunk metadata before phase 1 Enrico Plantulli
2026-08-10 10:19 ` Christian Ebner
2026-08-10 15:05 ` Enrico Plantulli
2026-08-10 5:02 ` [PATCH proxmox-backup 3/3] ui: tuning: add GC chunk metadata prefetch option Enrico Plantulli
2026-08-10 10:13 ` [PATCH proxmox proxmox-backup 0/3] datastore: gc: prefetch chunk metadata before phase 1 Christian Ebner
2026-08-10 20:32 ` Enrico Plant
2026-08-11 8:23 ` Christian Ebner
2026-08-11 9:37 ` Enrico Plantulli [this message]
2026-08-11 9:37 ` [PATCH v2 proxmox 1/3] pbs-api-types: add gc chunk metadata prefetch tuning options Enrico Plantulli
2026-08-14 14:34 ` Christian Ebner
2026-08-11 9:37 ` [PATCH v2 proxmox-backup 2/3] datastore: gc: optionally defer and batch chunk atime updates Enrico Plantulli
2026-08-14 14:34 ` Christian Ebner
2026-08-11 9:37 ` [PATCH v2 proxmox-backup 3/3] ui: tuning: add GC chunk metadata prefetch options Enrico Plantulli
2026-08-14 14:48 ` [PATCH v2 proxmox proxmox-backup 0/3] datastore: gc: defer and batch chunk atime updates Christian Ebner
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=20260811093722.735290-1-plantulli@gmail.com \
--to=plantulli@gmail.com \
--cc=pbs-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