From: Jakob Klocker <j.klocker@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [PATCH proxmox-datacenter-manager 0/2] fix #7731: metric collection: fetch large PVE clusters node by node
Date: Thu, 26 Nov 2026 17:07:05 +0100 [thread overview]
Message-ID: <20261126160707.333024-1-j.klocker@proxmox.com> (raw)
On larger PVE clusters, metric collection fails completely: the
cluster-wide /cluster/metrics/export request makes the node handling
it fetch the metrics of all other cluster members one after another,
which can take longer than pveproxy's 30 second request timeout. The
reporter measured ~2m40s for a 25 node cluster [0][1].
This series fetches the metrics of clusters with at least 3 nodes node
by node, using the `node-list` parameter of the export endpoint. Every
request then only covers a single node and stays below the timeout.
PVE versions without `node-list` fall back to the cluster-wide request.
The nodes are fetched sequentially. A parallel version was implemented
and tested first, but turned out to be unreliable: a node whose API
does not answer blocks the pveproxy worker on the endpoint for 20
seconds, and other requests that end up on the same worker are cut
off. The first patch describes this in detail. As metric collection
runs in the background, reliability was preferred over speed.
Testing:
Tested on a 5-node PVE 9.2 cluster (10 containers per node), a 2-node
cluster and a single PVE 8 node:
- 5 nodes: one request per node, strictly one after another (checked
with temporary log lines and the pveproxy access log).
- 2 nodes: unchanged, a single cluster-wide request.
- Node powered off: answered immediately with an empty result, all
other nodes are collected as usual.
- Node API unreachable (pveproxy stopped, packets dropped): ~20s
longer, as before, without losing any other node. With parallel
requests, a healthy node was lost in ~3 of 5 runs.
- PVE 8 without `node-list`: the request is rejected and the
cluster-wide fallback is used.
Fetching node by node adds no measurable overhead: a full collection
(full metric history, ~10.5 MB) took ~1.6s through PDM, the same as
the previous single cluster-wide request.
Possible follow-ups:
- PVE: the export endpoint forwards the request to other nodes itself,
using a blocking HTTP client (20s timeout), similar to what `proxyto`
does for node-scoped endpoints. Unlike `proxyto`, which pveproxy
handles asynchronously, this blocks the worker and affects all other
connections on it. A node-scoped export endpoint using `proxyto`
would avoid this and would allow fetching the nodes in parallel.
- PDM: querying each node directly at its own endpoint with
`local-only` would avoid the fan-out entirely and would allow
fetching the nodes in parallel again.
After some discussion with Lukas, I decided not to pursue any of these
follow-ups for now, as a broader refactoring of metric collection might
make more sense, for example, adding a mechanism to directly import a
product's RRD database, including the entire history.
[0] https://bugzilla.proxmox.com/show_bug.cgi?id=7731
[1] https://forum.proxmox.com/threads/getting-client-timeouts-in-pdm-system-log.184344/#post-858021
proxmox-datacenter-manager:
Jakob Klocker (2):
fix #7731: metric collection: fetch large PVE clusters node by node
metric collection: add tests for fetching PVE clusters node by node
.../remote_collection_task.rs | 376 ++++++++++++++++--
1 file changed, 352 insertions(+), 24 deletions(-)
Summary over all repositories:
1 files changed, 352 insertions(+), 24 deletions(-)
--
Generated by murpp 0.12.0
next reply other threads:[~2026-11-26 16:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 16:07 Jakob Klocker [this message]
2026-11-26 16:07 ` [PATCH proxmox-datacenter-manager 1/2] fix #7731: metric collection: fetch large PVE clusters node by node Jakob Klocker
2026-11-27 9:54 ` Lukas Wagner
2026-11-26 16:07 ` [PATCH proxmox-datacenter-manager 2/2] metric collection: add tests for fetching " Jakob Klocker
2026-11-27 9:46 ` Lukas Wagner
2026-11-27 14:05 ` superseded: [PATCH proxmox-datacenter-manager 0/2] fix #7731: metric collection: fetch large " Jakob Klocker
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=20261126160707.333024-1-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.