- changed status to closed
Wrong monit cpu usage value with processes spawning too many threads
Issue #643
closed
Hi, I started to watch lxd with monit, to because for some reason I got a 105+ % cpu utilization (top) on the lxd process. Monit interpreted this as a ~ 13% load. After noticing https://bitbucket.org/tildeslash/monit/issues/230, I suppose the reason for this discrepancy would be the fact that somehow lxd managed to run with 87 threads on a 4 core / 8 threads cpu (after monit restarts the lxd service, the thread count drops to 14) and this increased threadcount resulted into bogus cpuload numbers.
I'm not sure why/how lxd does this, I only started to investigate the issue, nontheless monit still gives me skewed numbers.
Using Ubuntu-packaged version: 1:5.16-2
Comments (1)
-
repo owner - Log in to comment
13% CPU load on 8 CPU threads corresponds ~ to 105% cpu usage in top. The formula is explained in monit manual (https://mmonit.com/monit/documentation/monit.html#Process-resource-tests) and
#230.If the process has more threads then CPUs, the result is always the same (the number of process threads has no effect in this case).