As I sit here stress-testing one of my Linux boxes I figured I would share with you guys the two scripts I have written to accomplish this. These two scripts simply peg one CPU/core. You will have to execute 1 instance of the script for each CPU/core on your machine to truly put it through it’s paces.
WARNING: THESE SCRIPTS CAN AND WILL PUSH YOUR MACHINE TO ITS LIMITS! IF YOU HAVE EVEN A SLIGHT ISSUE WITH THE COOLING/HARDWARE IN YOU MACHINE IT’S STRONGLY ADVISED THAT YOU DO NOT RUN THESE! THESE SCRIPTS CAN DAMAGE HARDWARE IF USED INCORRECTLY!!!!
Alright, now that we have that out of the way, here ya go:
Windows VBScript:
1) Copy and paste this into notepad:
i=0
while 1<2
i = i + 1
wend
2) Save as ‘max_cpu.vbs’ in a location that’s convenient for you.
3) OPEN TASK MANAGER NOW (If you don’t do it now you will never get it open)!!!!!
4) Run the script (by double clicking) for each CPU/core you have on your machine. In task manager you should see a wscript.exe for each time you double click it.
5) When you have completed the testing kill all the wscript.exe processes you see in task manager.
Linux bash script:
1) Copy and paste this into gedit:
#!/bin/bash
let count=0
while :
do
echo “Count is: $count”
((count++))
done
2) Save as ‘max_cpu.sh’ in a location that’s convenient for you.
3) Make the script executable (‘chmod a+x max_cpu.sh’ usually works).
4) Run the script, ‘./max_cpu.sh’ will do it. Repeat this for every CPU/core on your machine. You will have to have a separate terminal for each one.
5) When you have completed your testing do a ‘CTRL + C’ in each of the terminal windows that you executed the script in to kill the process.
While not really required, it’s strongly advised that you reboot after these ‘tests’ to make sure things get cleaned up. These don’t make any change to the OS but sometimes (especially with Windows) it will not fully release the resources used after the process(es) is(are) terminated.
