Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

How can I put my CPU under very high pressure for a long period of time? Are there programs for that that I can keep running ?

share|improve this question
add comment

5 Answers

Several database systems are multicore optimized. You could install something like mysql and setup a basic data set, then run some of the benchmarking tools against it. If tuned correctly, many DB systems are most efficient at high CPU load (because if it was not, you would be wasting resources).

Or, you could just wash a flash video in Safari.

share|improve this answer
add comment

Do the following once for each CPU core in your Mac, open Terminal.app and enter the command:

yes

The yes command will print the letter y to standard output in an infinite loop.

share|improve this answer
    
The OS may not assign this once to each core, and even so, just outputting yes to the terminal may push a cpu at 100%. –  jmlumpkin Jan 20 '13 at 20:58
5  
To run this once for each core: ncpu=$(sysctl hw.ncpu | awk '{ print $2; }'); for ((i=1;i<=ncpu;i++)); do yes >/dev/null & done –  Gordon Davisson Jan 20 '13 at 21:37
    
@jmlumpkin It works. At least on current Apple platforms. –  Max Ried Jan 21 '13 at 17:55
    
I think I read your answer a bit differently. What I was trying to say is that Terminal is going to distribute for this, and saying 'do this once for each core' isn't going to peg a quad core i5 at 400% utilization. I read your answer much more as 'doing this in a new terminal window will assign it to another core'. –  jmlumpkin Jan 21 '13 at 18:08
add comment

Look at some distributed computing like Boinc. This runs compute intensive programs where tasks are taken and run across many machines thus allowing projects access to free computing power. In your case as the programs take up much compute power they will use the CPU heavily. Boinc runs multiple processes on your computer so will se all cores of your CPU.

share|improve this answer
add comment

At the command line, run this command:

cat < /dev/urandom > /dev/null

(Open up a terminal window and type that into the window.)

This should keep your CPU loaded nicely for as long as you allow the command to run.

share|improve this answer
1  
This will only use one core/thread so not take up 100% CPU –  Mark Jan 20 '13 at 10:27
2  
@Mark so have multiple instances running. Easy solution. –  JoshRagem Jan 20 '13 at 12:15
    
Multiple instances (as in, one per core), wouldn't exactly mean they get distributed to an individual core by the OS. –  jmlumpkin Jan 20 '13 at 20:57
add comment

Just create a small program that loops infinitely, something like:

#include <stdio.h>
int main()
{
    int i=0;
    for(;;)
    {
         i++;
         i--;
    }
}
share|improve this answer
4  
This only runs on one thread so will not run at 100% of your CPU as all Macs are multi core. Also a good optimiser will probablget rid of that loop –  Mark Jan 20 '13 at 10:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.