How can I produce high CPU load on Windows?

For testing purposes I need to generate high CPU load on a Windows Server 2003. I cannot install any software but have to make do with what Windows provides.

What would be the best way to achieve that?


consume.exe from the Windows Server 2003 Resource Toolkit can do this easily.

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\x64>consume -cpu-time -time 5
Consume: Message: Time out after 5 seconds.
Consume: Message: Successfully assigned process to a job object.
Consume: Message: Attempting to start 256 threads ...
................................................................................
................................................................................
................................................................................
................
Consume: Message: Sleeping...

Uses 100% CPU time on all cores as long as it runs. It can also consume other resources (as the name implies).


The following batch file does it:

@echo off
:loop
goto loop

However, if you have multiple cores, you have start multiple instances.

To stop, press Ctrl+C in the console.


IntelBurnTest and Prime95 are known for doing just this. They don't really require installation, as they can be run by unpacking their respective zips, but it doesn't fulfill your "must be native" requirement. I'm an overclocker, and these are the tools I use to ensure absolute system stability, they will generate the utmost load from your computer.

As for your want for it to be a native piece of software - windows doesn't really come with the tools to do such a thing, except for maybe the above batch file, which is going to be a mess to handle if it goes haywire. (Infinite loops can be messy.)


A tight loop in VBS with no I/O will do it. You'll need as many processes as cores. The following will use 100% on my Win2k3 VM, or 50% on my dual-core host (100% if I launch 2)

c:\test\>copy con thing.vbs
While True
Wend
^z
c:\test\>thing.vbs

You'll have to kill wscript.exe in the task manager to end it.