
How to stress the CPU on your mac
There are a number of reasons that you might need to rev your CPU to the limit on command; you might be experiencing instability under high load and you want to run some controlled tests, or maybe you need to quickly drain the battery on your laptop before disassembly and repair.
Your mac comes with a command-line app called ‘yes’ which you can use to generate CPU load. Just open up Terminal and run ‘yes > /dev/null’ for every CPU that you want to use. If you have a 4 core computer and want to max out all the cores run:
yes > /dev/null & yes > /dev/null & yes > /dev/null & yes > /dev/null
command-c will exit the command line but will only kill one of your N processes so you’ll need to do this to shut down the others:
killall -HUP yes

The “yes” command will use 100% of a single CPU. The Mac pictured here has a 6-core i7 processor with hyperthreading which means the software sees 12 CPUs. If we wanted to truly max out the machine, we would have needed to spawn 5 more instances of “yes”.