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?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
consume.exe from the Windows Server 2003 Resource Toolkit (download link, on archive.org) 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).
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.
CPUGrabEx is a free tool that can grab CPU and GPU.
There is a SysInternals tool called CPU Stress.
CpuStres is a utility that can be used to simulate CPU activity by running up to 64 threads in a tight loop.
Each thread can be started, paused or stopped independently and can be configured with the following parameters:
- Activity Level This can be Low, Medium, Busy or Maximum which controls >how long the thread sleepss between cycles. Setting this value to Maximum >causes the thread to run continuously.
- Priority This controls the thread priority...
for /l %a in (0,0,1) do echo a in a command prompt (infinite loop printing
a) has the observed effect of starting a
conhost.exe running at 10-20% CPU load on Windows 7 on a low-end mobile i5. You could try running several of these in parallel, for example the following in a batch file:
start for /l %%a in (0,0,1) do echo a start for /l %%a in (0,0,1) do echo a start for /l %%a in (0,0,1) do echo a start for /l %%a in (0,0,1) do echo a start for /l %%a in (0,0,1) do echo a start for /l %%a in (0,0,1) do echo a start for /l %%a in (0,0,1) do echo a start for /l %%a in (0,0,1) do echo a start for /l %%a in (0,0,1) do echo a start for /l %%a in (0,0,1) do echo a
That could have your CPU running at 100%. Lines can be added/removed to adjust.
Warning: Those are infinite loops, which you may have trouble closing. The numbers inside the parentheses can be replaced, e.g.
(0,1,10000), for a finite loop. The last number (in the finite loop) can be adjusted to adjust the running time. In case you are wondering, it basically means "start at number 0, increment by 1 until it reaches 10000", which translates to 10000 loop cycles.
HyperPi (GUI to run SuperPi on multiple cores) can be run without installing just copy it to the server and run it from any location. Even on something fast you can load up all the cores for few hours doing say 16 simultaneous 32M place calculations.
I have recently discovered and can recommend the free version of HeavyLoad:
Does an effective job at pumping up the CPU levels to see how applications cope under duress.
The way most people do it is to run something that does a load of processing - I was recommended superpi, though hyperpi might work better for a modern system. Calculate absurdly large value of pi, and it'll effectively run the processor at full load.
Alternatively you can run StressCPU which is based off folding@home
If you need to keep high loads for longer periods of time, consider something like folding@home
If you have no internet for that pc or can't remember the website for that cpu test, and you don't feel like scripting you can use the windows built in zip feature to compress a bunch of files or folders a bunch of times simultaneously.
Right-click the file or folder, point to Send To, and then click Compressed (zipped) Folder
You can do the same files/folder multiple times at the same time, I suggest using the windows or program files folders.
You can then unzip the files to another location and do a file compare with the fc command to check to see that all calculations occurred correctly. Though I would suggest that you use a single big file for this as the command syntax for file comparison of a lot of files with standard windows tools is annoying.
I saw a few answers that said to run multiple instances, and I wasn't sure how to do that immediately, so I combined a couple of answers already in this ticket for this.
This will work from the command line that you are on after booting to command prompt from the advanced startup options. You don't need the Internet, and hopefully it is clear how to follow the steps.
@echo off :loop goto loop
start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat start stress1.bat