public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-datacenter-manager 0/2] fix #7731: metric collection: fetch large PVE clusters node by node
@ 2026-11-26 16:07 Jakob Klocker
  2026-11-26 16:07 ` [PATCH proxmox-datacenter-manager 1/2] " Jakob Klocker
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jakob Klocker @ 2026-11-26 16:07 UTC (permalink / raw)
  To: pdm-devel

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-27 14:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 16:07 [PATCH proxmox-datacenter-manager 0/2] fix #7731: metric collection: fetch large PVE clusters node by node Jakob Klocker
2026-11-26 16:07 ` [PATCH proxmox-datacenter-manager 1/2] " 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

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