Putting a value on the load of a windows system

I've written an image processing script in php which is run as a cron scheduled task (in OSX). To avoid overloading the system, the script checks the system load (using 'uptime') and only runs when load is below a predefined threshold.

I've now ported this over to Windows (2003 Server) and am looking for a similar command line function to report system load as an integer or float.

Answers


You can try this at a windows command line. This works in XP, get a lot of other info too.

wmic CPU


Don't use load...

The system load is not a good indicator in this case. On Unix it essentially tells you, how many processes are ready and waiting to be executed at the moment. But since there are numerous reasons for why a process might have to wait, your script may actually be able to run without costing another process any performance, even if the "load" on the system is high.

... use nice

You should use nice(1) on Unix and the equivalent on Windows ("Process Priority"?), so the OS can decide, when to run your script!

If you set the priority of your script to the absolute lowest possible priority then it will only be executed by the scheduler when there is nothing else to do at the moment.

Probably you will have to implement some kind of mechanism to prevent more than one instance of your script to be run at the same time, in case it takes longer to execute than the interval between to invocations lasts.


Need Your Help

openGL: glGenVertexArrays Access violation executing location 0x00000000

c++ opengl

I'm trying to learn openGL myself so I bought a book about openGL and in first chapter are example code so I try it and something went wrong. At line 17(glGenVertexArrays(

Is there any package management system for MinGW+MSYS?

gcc mingw apt-get package-managers msys

I am trying to compile some open source libraries in MinGW+MSYS. During the configure phase, I kept seeing some 3rd party libraries are missing.