I'm writing a program that will perform some logging of my company's webserver load. One information I need to log is the server's CPU Load.
I know that CPU Load -- in monit
or top
/htop
-- reflects the total load across cores, normalized against 1 core. So, for an 8 core server, the total load (when it's heavily loaded) will be higher than 100%. And when all cores are running full load, might reach 800%.
However, monit and top/htop also might show oversubscribed CPU Load, in which the CPU Load number is higher than 800%, indicating that jobs are being queued.
I'm interested in such situation.
My questions:
Does the
psutil.cpu_times_percent()
function behave the same as monit's/top's CPU Load indicator? That is, will the percentage returned be higher than 100% (cpu_times_percent()
normalizes to 100% instead of to 1 core) if there are jobs being queued?If the answer to #1 is "no", then how can I detect oversubscription / jobs being queued?