From: "Lukas Wagner" <l.wagner@proxmox.com>
To: "Jakob Klocker" <j.klocker@proxmox.com>, <pdm-devel@lists.proxmox.com>
Subject: Re: [PATCH proxmox-datacenter-manager 1/2] fix #7731: metric collection: fetch large PVE clusters node by node
Date: Fri, 27 Nov 2026 10:54:16 +0100 [thread overview]
Message-ID: <DN5WHPDOVT33.2GB6G1SKQM5B2@proxmox.com> (raw)
In-Reply-To: <20261126160707.333024-2-j.klocker@proxmox.com>
On Thu Nov 26, 2026 at 5:07 PM CET, Jakob Klocker wrote:
> On larger clusters, a single cluster-wide /cluster/metrics/export
> request can take longer than pveproxy's 30 second request timeout, as
> the node handling it fetches the metrics of all other cluster members
> one after another. The reporter [0] measured ~2m40s for a 25-node
> cluster, so no metrics were collected for such clusters at all.
>
> For clusters with at least 3 nodes, request the metrics of each node
> separately via the `node-list` parameter and merge the results. At
> ~6.5 seconds per node with the full metric history, even a few nodes
> can exceed the timeout. PVE versions without `node-list` reject the
> parameter, so the cluster-wide request is used for those instead.
>
> Fetching the nodes in parallel through one cluster node turned out to
> be unreliable. The export endpoint fetches the metrics of the requested
> node with a blocking HTTP request (timeout 20s), so a node whose API
> does not answer freezes the pveproxy worker handling that request for
> 20 seconds. A worker handles its connections one at a time, and
> parallel requests often end up on the same worker. pveproxy's 5 second
> inactivity timeout expires during the freeze, so the other connections
> on that worker are closed: responses are cut off or requests dropped.
> On a 5-node test cluster with one node's API unreachable, this lost the
> metrics of a healthy node in most runs.
>
> As metric collection runs in the background and has to be reliable
> rather than fast, fetch the nodes one after another, so no request can
> wait behind a blocked worker. Parallel fetching would become safe if
> each node were queried directly at its own endpoint.
>
Looks mostly good so far from a first look.
As discussed off-list already, I think this could be improved by
extending the state file to have per-node timestamps for the most recent
datapoint.
Right now, there is a single timestamp that will be used for the
starttime of the next request, meaning that an offline cluster node
coming back online will not be backfilled with the still available
history.
One thing we dicussed was also the threshold used to switch to the
per-node mode. Three nodes is a rather low limit, but given the measured
data from the bug report it seems reasonable. It's so low that it
*could* make sense to just always fetch per node, which would also fix
the behavior decribed already for smaller setups (where a node coming
back online would cause a gap in the metrics).
And as you also mentioned, we need to investigate better methods for
fetching metrics (such as directly importing the history from the
product's RRD DB), but this is a much larger task.
next prev parent reply other threads:[~2026-11-27 9:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=DN5WHPDOVT33.2GB6G1SKQM5B2@proxmox.com \
--to=l.wagner@proxmox.com \
--cc=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