Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 236439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:20:43+00:00 2026-05-11T20:20:43+00:00

Does anyone know an elegant way to determine System Load preferably using Windows performance

  • 0

Does anyone know an elegant way to determine “System Load” preferably using Windows performance counters? In this case I mean “System Load” in the classical (UNIX) sense of the term and not in the commonly confused “CPU Utilization” percentage.

Based on my reading … “System Load” is typically represented as a float, defining the number of processes in a runnable state (i.e. not including the number of processes that are currently blocked for one reason or another) that could be run at a given time. Wikipedia gives a good explanation here – http://en.wikipedia.org/wiki/Load_(computing).

By-the-way I’m working in C# so any examples in that language would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:20:43+00:00Added an answer on May 11, 2026 at 8:20 pm

    System load, in the UNIX sense (and if I recall correctly), is the number of processes which are able to be run that aren’t actually running on a CPU (averaged over a time period). Utilities like top show this load over, for example, the last 1, 5 and 15 minutes.

    I don’t believe this is possible with the standard Win32 WMI process classes. The process state field (ExecutionState) in the WMI Win32_Process objects are documented as not being used.

    However, the thread class does provide that information (and it’s probably a better indicator as modern operating systems tend to schedule threads rather than processes). The Win32_Thread class has an ExecutionState field which is set to one of:

    • 0 Unknown
    • 1 Other
    • 2 Ready
    • 3 Running
    • 4 Blocked
    • 5 Suspended Blocked
    • 6 Suspended Ready

    If you were to do a query of that class and count up the number of type 2 (and possibly type 6; I think suspended means swapped out in this context), that should give you your load snapshot. You would then have to average them yourself if you wanted averages.

    Alternatively, there’s a ThreadState in that class as well:

    • 0 Initialized (recognized by the microkernel).
    • 1 Ready (prepared to run on the next available processor).
    • 2 Running (executing).
    • 3 Standby (about to run, only one thread may be in this state at a time).
    • 4 Terminated (finished executing).
    • 5 Waiting (not ready for the processor, when ready, it will be rescheduled).
    • 6 Transition (waiting for resources other than the processor).
    • 7 Unknown (state is unknown).
      so you could look into counting those in state 1 or 3.

    Don’t ask me why there’s two fields showing similar information or what the difference is. I’ve long since stopped second-guessing Microsoft with their WMI info, I just have to convince the powers that be that my choice is a viable one 🙂

    Having just finished developing a Windows client for our own monitoring application, I’d just suggest going for 1-second snapshots and averaging these over whatever time frame you need to report on. VBScript and WMI seem remarkably resilient even at one query per second – it doesn’t seem to suck up too much CPU and, as long as you free everything you use, you can run for extended periods of time.

    So, every second, you’d do something like (in VBScript, and from memory since I don’t have ready access to the code from here):

    set objWmi = GetObject("winmgmts:\\.\root\cimv2")
    set threadList = objWmi.ExecQuery("select * from Win32_Thread",,48)
    sysLoad = 0
    for each objThread in threadList
        if objThread.ThreadState = 1 or objThread.ThreadState = 3 then
            sysLoad = sysLoad + 1
        end if
    next
    ' sysLoad now contains number of threads waiting for a CPU. '
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 155k
  • Answers 155k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer As I understand it, you are effectively asking for ways… May 12, 2026 at 10:41 am
  • Editorial Team
    Editorial Team added an answer It's cleaner if you inject the web service into the… May 12, 2026 at 10:41 am
  • Editorial Team
    Editorial Team added an answer The only thing you need to do is to link… May 12, 2026 at 10:41 am

Related Questions

I'm designing a system which is receiving data from a number of partners in
I am new to C# so I apologize if this is a simple task.
I'm curious if there is an efficient way to wait for the front page
EmployeeNumber = string.IsNullOrEmpty(employeeNumberTextBox.Text) ? null : Convert.ToInt32(employeeNumberTextBox.Text), I often find myself wanting to do

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.