What is the closest equivalent of "load average" in Windows available via WMI?

15,716

Solution 1

The Process Queue Length count from the System performance counter object is:

Processor Queue Length is the number of threads in the processor queue[...]

This value is available in WMI via Win32_PerfFormattedData_PerfOS_System.

Solution 2

I don't know of any such measure of overall work-demand, it's just percent-CPU with some breakdown in the kinds of CPU demanded. This does make it hard to figure out just how overloaded a machine is. When a Linux system is reporting a Load Average of 63 and the Windows system is reporting 100% CPU... well, they're both running flat out, but that's about all you can tell about the Windows system.

Solution 3

I'm not sure that there is anything in windows that would be equivalent, and I'm not sure it would mean anything if there were there. From the description I can't see how a process would fail to be included as even a hung or suspended process would get CPU time allocated. Additionally it's more relevant to look at threads and runnable threads rather than processes under windows in order to determine any notion of load by the definition provided.

Solution 4

If you're using Python, psutil emulates getloadavg() on Windows via the Processor Queue Length:

 >>> import psutil
 >>> psutil.getloadavg()
 (3.14, 3.89, 4.67)

PR showing how this is done: https://github.com/giampaolo/psutil/pull/1485

Share:
15,716

Related videos on Youtube

leonigmig
Author by

leonigmig

Updated on September 18, 2022

Comments

  • leonigmig
    leonigmig almost 2 years

    Linux has a notion of Load Average which is defined as:

    System load averages is the average number of processes that are either in a runnable or uninterruptable state. A process in a runnable state is either using the CPU or waiting to use the CPU. A process in uninterruptable state is waiting for some I/O access, eg waiting for disk. The averages are taken over the three time intervals. Load averages are not normalized for the number of CPUs in a system, so a load average of 1 means a single CPU system is loaded all the time while on a 4 CPU system it means it was idle 75% of the time.

    What is the closest equivalent available via WMI? Fundamentally are there differences between the two OSes which determinate how such a performance metric should be measured? What are the differences?

  • leonigmig
    leonigmig over 12 years
    Digging in a bit this answer stackoverflow.com/questions/807506/… seems to give a good view of the differences between the OSes.
  • user2968902
    user2968902 about 7 years
    Annoyingly, "This property displays the last observed value only; it is not an average." :-|
  • GreyCat
    GreyCat almost 6 years
    This is just CPU usage percentage over the last sampling period, it has nothing in common with "load average".
  • Amit Bhaira
    Amit Bhaira about 5 years
    Process Queue Length only represent the number of processes waiting for CPU. It does not show processes waiting for disk I/O or Network I/O. However, linux counterpart consider processes in uninterruptible sleep state also in its load calculation. Processes in this state denotes that they are waiting for some kind of I/O.