13

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
  • 317
  • 2
  • 4
  • 8

5 Answers5

11

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.

Richard
  • 5,309
  • 1
  • 22
  • 20
  • Digging in a bit this answer http://stackoverflow.com/questions/807506/threads-vs-processes-in-linux seems to give a good view of the differences between the OSes. – leonigmig Nov 08 '11 at 10:10
  • 1
    Annoyingly, "This property displays the last observed value only; it is not an average." :-| – Blaisorblade May 01 '17 at 16:07
  • 1
    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. – Amit Bhaira May 07 '19 at 11:25
4

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.

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
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.

Jim B
  • 23,938
  • 4
  • 35
  • 58
2

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

0

You can get an instantaneous CPU load as a percentage with this command:

wmic cpu get loadpercentage

Which returns:

LoadPercentage
10

Unfortunately, I don't see any time averages from wmic cpu get, which would be nice.

Mike T
  • 751
  • 2
  • 8
  • 10
  • 1
    This is just CPU usage percentage over the last sampling period, it has nothing in common with "load average". – GreyCat Jul 13 '18 at 11:49