[pve-devel] [PATCH container] fix #4765: lxc: report cpu usage correctly

Fiona Ebner f.ebner at proxmox.com
Fri Jun 23 13:54:27 CEST 2023

Am 20.06.23 um 17:46 schrieb Maximiliano Sandoval:
> When running `pct status VMID` the variable

Issue is only present with --verbose.

> $last_proc_vmid_stat->{$vmid} is not set and pct reports no cpu usage.
> We address this by computing the used cpu time over the total uptime of
> the container.

qm would have the same issue, but there, we don't even output a line for
"cpu:" ;)

IMHO, the average of the CPU usage across the whole uptime is not what
most people would expect this value to be. Maybe we should just remove
the line from the output like in qm (technically a breaking change) or
maybe query the CPU stats twice with a small time window in between?

No matter what approach we go for, the behavior of qm and pct should be
made consistent here (if no good reason against it pops up).

More information about the pve-devel mailing list