From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/2] garbage collection: track chunk cache stats and show in task log
Date: Fri, 16 May 2025 10:58:36 +0200 [thread overview]
Message-ID: <20250516085836.82494-3-c.ebner@proxmox.com> (raw)
In-Reply-To: <20250516085836.82494-1-c.ebner@proxmox.com>
Count the chunk cache hits and misses and display the resulting
values in the garbage collection task log summary.
This allows to investigate possible issues and tune cache capacity,
also by being able to compare to other values in the summary such
as the on disk chunk count.
Exemplary output
```
2025-05-16T10:41:29+02:00: Chunk cache: hits 38118, misses 10017
2025-05-16T10:41:29+02:00: Removed garbage: 3.384 GiB
2025-05-16T10:41:29+02:00: Removed chunks: 2835
2025-05-16T10:41:29+02:00: Original data usage: 155.165 GiB
2025-05-16T10:41:29+02:00: On-Disk usage: 7.312 GiB (4.71%)
2025-05-16T10:41:29+02:00: On-Disk chunks: 10017
2025-05-16T10:41:29+02:00: Deduplication factor: 21.22
2025-05-16T10:41:29+02:00: Average chunk size: 765.438 KiB
```
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
pbs-datastore/src/datastore.rs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index cbf78ecb6..479b76cd8 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -1086,8 +1086,10 @@ impl DataStore {
// Avoid multiple expensive atime updates by utimensat
if chunk_lru_cache.insert(*digest, ()) {
+ status.cache_hits += 1;
continue;
}
+ status.cache_misses += 1;
if !self.inner.chunk_store.cond_touch_chunk(digest, false)? {
let hex = hex::encode(digest);
@@ -1349,6 +1351,10 @@ impl DataStore {
worker,
)?;
+ info!(
+ "Chunk cache: hits {}, misses {}",
+ gc_status.cache_hits, gc_status.cache_misses,
+ );
info!(
"Removed garbage: {}",
HumanByte::from(gc_status.removed_bytes),
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2025-05-16 8:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 8:58 [pbs-devel] [PATCH proxmox proxmox-backup 0/2] add GC chunk cache stats Christian Ebner
2025-05-16 8:58 ` [pbs-devel] [PATCH proxmox 1/1] pbs api types: extend garbage collection status by " Christian Ebner
2025-05-16 8:58 ` Christian Ebner [this message]
2025-05-16 9:54 ` [pbs-devel] [PATCH proxmox-backup 2/2] garbage collection: track chunk cache stats and show in task log Lukas Wagner
2025-05-16 10:29 ` Christian Ebner
2025-05-19 5:56 ` [pbs-devel] superseded: [PATCH proxmox proxmox-backup 0/2] add GC chunk cache stats 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=20250516085836.82494-3-c.ebner@proxmox.com \
--to=c.ebner@proxmox.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal