From: Jakob Klocker <j.klocker@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [PATCH proxmox-datacenter-manager v2 2/2] fix #7731: metric collection: allow 5 minutes for PVE metric requests
Date: Fri, 27 Nov 2026 15:03:58 +0100 [thread overview]
Message-ID: <20261127140358.205440-3-j.klocker@proxmox.com> (raw)
In-Reply-To: <20261127140358.205440-1-j.klocker@proxmox.com>
Exporting the full metric history of a large PVE cluster can take
minutes: on a 25-node cluster with about 2800 guests, the export took
2m43s. The client's request timeout of 60 seconds cut such requests
off, and the request was repeated on every other endpoint of the remote
until all of its nodes were marked unreachable, so no metrics were ever
collected for such a cluster.
Use a client with a 5 minute timeout for fetching the metrics of PVE
remotes. All other requests keep the shorter timeout, so they still
fail over quickly to the next endpoint when a node does not answer.
Signed-off-by: Jakob Klocker <j.klocker@proxmox.com>
---
server/src/metric_collection/remote_collection_task.rs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/server/src/metric_collection/remote_collection_task.rs b/server/src/metric_collection/remote_collection_task.rs
index 1e0011cb..b5d102fa 100644
--- a/server/src/metric_collection/remote_collection_task.rs
+++ b/server/src/metric_collection/remote_collection_task.rs
@@ -36,6 +36,9 @@ const METRIC_COLLECTION_STATE_FILE: &str = concat!(
pub const MAX_CONCURRENT_CONNECTIONS: usize = 20;
+/// Timeout for fetching the metrics of a PVE remote.
+const PVE_METRICS_REQUEST_TIMEOUT: Duration = Duration::from_secs(5 * 60);
+
/// Default metric collection interval.
pub const DEFAULT_COLLECTION_INTERVAL: u64 = 600;
/// Minimum metric collection interval.
@@ -315,7 +318,9 @@ impl RemoteMetricCollectionTask {
let res: Result<RrdStoreResult, Error> = async {
match remote.ty {
RemoteType::Pve => {
- let client = app.client_factory().make_pve_client(&remote)?;
+ let client = app
+ .client_factory()
+ .make_pve_client_with_timeout(&remote, PVE_METRICS_REQUEST_TIMEOUT)?;
let metrics = client
.cluster_metrics_export(
Some(true),
--
2.47.3
prev parent reply other threads:[~2026-11-27 14:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 14:03 [PATCH proxmox-datacenter-manager v2 0/2] fix #7731: metric collection: allow 5 minutes for PVE metric requests Jakob Klocker
2026-11-27 14:03 ` [PATCH proxmox-datacenter-manager v2 1/2] connection: allow creating PVE clients with a custom request timeout Jakob Klocker
2026-11-27 14:03 ` Jakob Klocker [this message]
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=20261127140358.205440-3-j.klocker@proxmox.com \
--to=j.klocker@proxmox.com \
--cc=pdm-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