project-pegaprox icon indicating copy to clipboard operation
project-pegaprox copied to clipboard

[Bug] Triple the workload thanks to Pegaprox services on the node.

Open BlackGeeBo opened this issue 7 months ago • 15 comments

Describe the bug

Steps to Reproduce

  1. systemctl stop pegaprox-smbios-autoconfig && systemctl stop pegaprox-agent

Someone tell´s me with my last Ticket, Pegaprox was not install any services on the Nodes! That must have been a mistake!

Screenshot without any started pegaprox-service:

Image
  1. systemctl start pegaprox-smbios-autoconfig && systemctl start pegaprox-agent Screenshot with activated pegaprox-services on each node:
Image

- What should happen instead? -->

No threefold increase in capacity utilisation.

Environment

  • PegaProx Version: PegaProx Beta 0.9.6.1
  • Installation Method: Docker
  • OS: Debian 13,
  • Browser: Brave
  • Behind Reverse Proxy? No
  • UI? Corporate

Logs

Nothing to see


Checklist

  • [x ] I have searched existing issues to make sure this is not a duplicate
  • [ x] I am using the latest version of PegaProx

BlackGeeBo avatar Apr 15 '26 18:04 BlackGeeBo

Hey @BlackGeeBo,

can you please provide any metrics of the services? Even a (h|a)top with the service consumptions would be fine to see which service is affected with which resource consumption.

Cheers, gyptazy

gyptazy avatar Apr 15 '26 18:04 gyptazy

Image Image Image Image

BlackGeeBo avatar Apr 15 '26 18:04 BlackGeeBo

for i in 1 2 3 4 5; do ps faux | grep [q]m; echo "---"; sleep $i; done

PS-AUSGABE.txt

BlackGeeBo avatar Apr 15 '26 18:04 BlackGeeBo

Hey @BlackGeeBo,

thanks for providing this but I must admit that I'm now even more confused. Initially you stated some explicit systemd units that should be a problem. In your provided information, none of them is present.

Cheers, gyptazy

gyptazy avatar Apr 15 '26 18:04 gyptazy

I actually took some screenshots for the Proxmox forum today. And whilst doing so, I noticed that the pegaprox services were running on every node. As soon as I stopped them, the nodes’ base load jumped back up to 5–10%.

The processes themselves didn’t show up anywhere. No idea what’s going wrong.

I’ve just double-checked it again and can confirm that as soon as the aforementioned pegaprox services are running, the nodes’ base load jumps back up to 20–30%.

If you tell me exactly what you’d like, I’ll be happy to provide it.

Here the link to my posting in the proxmox german forum:

https://forum.proxmox.com/threads/seit-update-auf-ver-9-1-7-haben-die-nodes-3-mal-h%C3%B6here-grundlast.182798/#post-848695

BlackGeeBo avatar Apr 15 '26 18:04 BlackGeeBo

Hi @BlackGeeBo ,

thanks for the report — before we can act on this we'd need a bit more substance, because "triple the workload" is a strong claim and two top snapshots alone don't really back it up.

1. Please rename the issue. The current title — "Triple the workload thanks to Pegaprox services on the node" — states an unverified claim as fact in a public, search-indexable bug tracker. That's not how a [Bug] title should read while the cause is still unconfirmed; it crosses into reputational territory we're not willing to leave standing without evidence. Please change it to something neutral, e.g.:

  • [Bug] Suspected CPU/load increase after enabling pegaprox-agent + smbios-autoconfig
  • [Perf] Possible workload regression with pegaprox services running
  • [Investigation] Higher node load observed with PegaProx services enabled

If the title isn't updated, I'll edit it myself per maintainer policy.

Looking at the screenshot, the node is doing a lot on its own, completely independent of PegaProx:

  • 2× KVM guests (ntopng, haos17.1) — together >4 GB RES, ntopng alone with 229h accumulated CPU time
  • Wazuh indexer (Java, ~1.5 GB RES, 26h+ CPU time) plus wazuh-modulesd (~310 MB) and the wazuh framework Python
  • zabbix_agent2, pihole-FTL, corosync (RT priority), multiple pveproxy / pvedaemon workers
  • Postgres 17, Apache2, Redis, lxcfs, lxc-start...

The single visible pegaprox process (PID 2588855) sits at 3.0 % CPU / 0.3 % MEM. For a 3× load increase to originate from pegaprox-agent + pegaprox-smbios-autoconfig, we'd expect a very different footprint than that.

Could you share:

  1. pidstat -u -r -p ALL 1 60 — once with the services stopped, once with them running, ideally with the VMs in a comparable state.
  2. systemd-cgtop -n 5 for both states, so we can see the actual cgroup attribution.
  3. Full pegaprox-agent and pegaprox-smbios-autoconfig logs covering the period of the spike.
  4. A load average or sampled CPU% over a fixed window — top values fluctuate per refresh, so a single frame isn't a measurement.

With Wazuh + two VMs + the rest of that stack on the same node, separating "PegaProx is the cause" from "something else happened to spike at the same time" really needs more than visual inspection. Looking forward to the data!

MrMasterbay avatar Apr 15 '26 18:04 MrMasterbay

In addition to the topic that things have been installed on the nodes. This must be explicitly done by an operator from the UI and is not done automatically (see screenshot):

Image

Hope it helps.

Cheers, gyptazy

gyptazy avatar Apr 15 '26 19:04 gyptazy

I’ll try to compile the requested data. The screenshots prove it, after all:

Image

Since Pegaprox was installed, the nodes’ baseline load has tripled: the black box shows the time and date when Pegaprox went live here.

And also when the services were deactivated today: the baseline load immediately dropped back to just 5–10%.

But I know that figures speak louder than pictures and mere statements. Therefore: data will be compiled and made available here.

Thanks and best regards

BlackGeeBo avatar Apr 15 '26 19:04 BlackGeeBo

Adding the stats from the same node for context.

perf top --sort comm,dso (4000 Hz, ~14K samples, ~7.17B cycles):

Overhead Command Shared Object
35.26 % qm perl
13.06 % pct perl
6.06 % qm [kernel]
5.40 % qm libc.so.6
3.72 % pct [kernel]
2.18 % pct libc.so.6

gotop on the same box (E3-1225, 4 cores):

  • CPU total: 35 %
  • Load avg: 0.84 / 1.32 / 1.18
  • Frequency: 800 MHz (idle scaling), temps 28–33 °C

Load average 1.32 on a 4-core CPU with the governor still at 800 MHz is not a "tripled" or "overloaded" node — there's substantial headroom and no thermal pressure. That's the absolute picture.

The perf profile does flag something worth checking on our end: qm and pct together account for ~66 % of sampled cycles. Both are Perl-based Proxmox CLIs, so if pegaprox-smbios-autoconfig shells out to them on a tight schedule, we'd see exactly this signature — lots of fork/exec/Perl-startup cost, very little real work. We'll look into the call frequency on our side regardless.

None of this changes the request: the pidstat -u -r -p ALL 1 60 and systemd-cgtop -n 5 comparison with services on vs. off is still what we need to confirm or refute the original claim.

MrMasterbay avatar Apr 15 '26 19:04 MrMasterbay

With active pegaprox-services:

pidstat -u -r -p ALL 1 60

pidstat-output-service-active.txt

systemd-cgtop -n 5

systemd-output-service-active.txt

With deactivated Services:

pidstat -u -r -p ALL 1 60

pidstat-output-deactivated-service.txt

systemd-cgtop -n 5

systemd-output-deactivated-service.txt

Thank you.

BlackGeeBo avatar Apr 15 '26 19:04 BlackGeeBo

Confirmed bug, fix is in main and will ship in the next patch release. Apologies for the initial pushback on the report — the time-series and the pidstat dump made the cause unambiguous and gave us everything we needed to land a real fix rather than a tactical patch.

What changed

Concrete diff in pegaprox-smbios-autoconfig:

Before After Effect
get_all_vms(): spawns qm list (Perl) reads /etc/pve/.vmlist (JSON) no subprocess, ~0 % CPU
check_vm_exists(): spawns qm status <vmid> (Perl) os.path.exists(conf) no subprocess
get_current_smbios(): spawns qm config <vmid> (Perl) reads the .conf file directly no subprocess
time.sleep(2) — 30 Perl spawns/min per VM time.sleep(30) — 2 file reads/min ~99 % less CPU

Instead of forking qm 30 times per VM per minute (each one a full Perl interpreter cold-start pulling in the Proxmox API library), the service now does 2 cheap pmxcfs reads per minute. That maps directly onto what your data showed: the qm/pct dominance in perf top (~66 % of sampled cycles), the 24 + 7 fresh-fork pattern in pidstat over a 60 s window, and the baseline shift in your Grafana chart all collapse together once the polling architecture is replaced.

Immediate cleanup (if you don't want to wait for the release)

This is the same routine the PegaProx UI runs when you uninstall the component, so no leftover state:

systemctl stop pegaprox-smbios-autoconfig
systemctl disable pegaprox-smbios-autoconfig
rm -f /etc/systemd/system/pegaprox-smbios-autoconfig.service
rm -f /opt/pegaprox-smbios-autoconfig.py
rm -f /var/lib/pegaprox-smbios-processed.txt
systemctl daemon-reload

Run on every node where it was deployed. pegaprox-agent is unaffected and continues to run normally.

On installation and operator consent

A clarification on the framing in the original report: PegaProx does not install, enable, or start any service on a Proxmox node without explicit administrator action through the UI. This isn't a soft policy on our side — it's a hard requirement we're audited against on a recurring basis under customer compliance reviews. NIS2 is the most prominent example right now, but several customer-specific regimes apply the same rule or even stricter: no silent installs, no silent activations, every component change requires operator consent and is recorded in the audit log.

pegaprox-smbios-autoconfig was deployed and started on your nodes because it was explicitly selected during the agent configuration step. That doesn't change anything about the bug analysis above — the polling design was wrong, your data showed it clearly, and it's now fixed — but it's worth stating plainly that the component didn't appear by itself, and any future component will continue to require explicit operator action.

A note on the hardware

For transparency going forward: our tested hardware floor is CPUs from 2013+ (Haswell-class and newer). The E3-1225 (Sandy Bridge, 2011) sits below that line, so issues that only manifest on pre-2013 silicon will be handled best-effort rather than prioritised.

Separate observation, meant constructively: that part is also a 4-core / 4-thread CPU — which is fairly tight for a Proxmox node running the workload your earlier top output showed (Wazuh indexer + modulesd + framework, multiple KVM guests, Pi-hole, Zabbix, Postgres, Apache, Redis, plus the cluster services). Even after our fix removes the polling overhead entirely, you'll likely still see real headroom pressure from the workload itself. The patched build will absolutely help — the architectural problem we fixed wasn't CPU-specific — but it won't change the fact that a 4-core 2011 Xeon is on the lighter side for a multi-service hypervisor of this density.

Next step

Happy to share a test build for validation before we tag, if you'd like to confirm the regression is gone on your cluster. Either way — thanks for sticking with this. The report ended up catching a real architectural issue, not just a single-deployment quirk, and the data you provided made the fix straightforward.

MrMasterbay avatar Apr 15 '26 20:04 MrMasterbay

PS:

Image

Das gesamte Entwicklungsteam ist Deutsch. "zurechtgestutzt" nachdem man etwas aktiv getriggert hat ist nunja.

MrMasterbay avatar Apr 15 '26 20:04 MrMasterbay

I would like to thank the team wholeheartedly for such a quick solution!

My sincere respect to the team.

I’m very happy to test the new version here in the cluster as well. And I’m well aware that it’s rather underpowered. But it’s a private geek project, so it’s more than enough for that. Everything is running really smoothly.

Once again, many thanks for your patience and your hard work! And, I promise: as soon as I can afford it again, I’ll make a donation! Unfortunately, that’s not possible at the moment, as I seem to be too old to work as an IT specialist after forty years. But the deal still stands! And maybe there’ll be enough for a little upgrade then too... ;-).

BlackGeeBo avatar Apr 15 '26 20:04 BlackGeeBo

PS:

Das gesamte Entwicklungsteam ist Deutsch. "zurechtgestutzt" nachdem man etwas aktiv getriggert hat ist nunja.

Kollega...ich bin kein Boxer und kein Schläger...warum glaubst Du, steht da ein Smily hinter...? Würde ich das so meinen, wie Du es hier aussehen lassen willst...sähe das ganz sicher anders aus. In diesem Sinne...einfach mal lockerer werden...das tut uns allen gut in diesen Zeiten. Have a nice Feierabend...;-).

BlackGeeBo avatar Apr 15 '26 20:04 BlackGeeBo

Manchmal fehlt einfach der Respekt. Ein kostenloses Projekt mit dem Ziel jedem das Proxmox Leben noch ein Stück schöner zu machen und dann liest man von zurechtstutzen - WTF. Danke für die tolle Arbeit :-)!!!

proxforge avatar Apr 18 '26 10:04 proxforge