macfidelity

|

rethinking the think-different thing

mac | How to stress-test your CPU in Mac OS X

May 10th, 2009 at 0:10

20090510_mac_cpu_stress_01

Sometimes people want or even need to produce some CPU-usage without big effort i.e. for testing issues.

The following article describes an easy way to realize that using the Terminal in Mac OS X.

System

Hardware

20090510_mac_cpu_stress_02

20090510_mac_cpu_stress_03

Software

  • CPUPalette.app to display CPU usage
  • yes command to generate some stress

CPUPalette.app is not installed on Mac OS X by default – while it is part of the free Apple Developer Tool-Set. If you are not willing to install CPUPalette – consider using Activity Monitor.app which is installed in

/Applications/Utilities/Activity Monitor.app

CPU Graphs

Idle

Which means – besides the basic processes i have Firefox, iTunes, RSS-Reader, Thunderbird runnig as i am writing while testing ;)

20090510_mac_cpu_stress_04

1 CPU Core

Now – lets start.

  • Open Terminal.app
  • Enter: yes > /dev/null
  • Press Enter

20090510_mac_cpu_stress_05

Lets check the CPU

20090510_mac_cpu_stress_06

2 CPU Cores

Now open a new Terminal window and do the re-do the above

20090510_mac_cpu_stress_05

Lets check the CPU

20090510_mac_cpu_stress_07

3 CPU Cores

Now open a new Terminal window and do the re-do the above

20090510_mac_cpu_stress_05

Lets check the CPU

20090510_mac_cpu_stress_08

4 CPU Cores

Now open a new Terminal window and do the re-do the above

20090510_mac_cpu_stress_05

Lets check the CPU

20090510_mac_cpu_stress_09

Lets take a look into Activity Monitor.app

20090510_mac_cpu_stress_10

and

20090510_mac_cpu_stress_11

Conclusion

Using the yes command and redirecting it to the black hole is a very simple but effective method to generate some CPU usage without big effort.

My 3 year old Mac Pro – first generation – easily handled the task – Mac OS X was acting without issues as expected. The temp increased slowly from 33 degree celcius up to 40 at the end.

Tags: , , , , , , ,

19 Responses to “mac | How to stress-test your CPU in Mac OS X”

  1. Mac | mac | How to stress-test your CPU in Mac OS X | Download Free Software Says:

    [...] the original here: mac | Ho&#119&#32&#116o stress-test your CPU in Mac OS X Nessun tag per questo [...]

  2. mac | Finder and the expand-all system stress test | macfidelity Says:

    [...] also noch mit minimal Mehraufwand im Terminal künstlich CPU Verbrauch produzieren – geht doch alles direkt aus der Schaltzentrale [...]

  3. rea Says:

    where is to download that aplication?(procesor)

  4. fidel Says:

    @rea

    Hi – which application are you talking about?

  5. rea Says:

    cpupalette.app where is to download?

  6. fidel Says:

    @rea:
    please read this post – i guess it might answer your question ;)
    http://macfidelity.de/2007/11/07/xcode-cpupaletteapp/

    Best Regards
    fidel

  7. bvac Says:

    Thanks for the tip! I’m trying to figure out what is wrong with a Mac Pro, first generation. It’s been freezing quite frequently, sometimes seconds after booting up, sometimes 30+ minutes, but pretty consistent. Sometimes one of the CPU diagnostic LEDs goes red when it freezes, but I ran four instances of yes > /dev/null for about 30 minutes without any freezes. I also ran memtest for a few hours without incident… so I think the Mac Pro may simply not want me to get any work done.

  8. fidel Says:

    @bvac

    hi – glad to hear this post was helpful for you.

    May i ask how those freezes happen & look like on your Mac Pro?
    Since when does that happen? (pre or post 10.6.3?)

    I’m asking as i am having similar issues here since some days – Mac Pro 1.1 like you.

    Best Regards
    fidel

  9. bvac Says:

    Hi fidel,

    It’s hard to tell how the freezes happen. Earlier this year I started getting artifacts on the screen, lines of random color, pixels that looked stuck or broken but really weren’t, et c. so I thought the video card was at fault. Then it began to lock up on occasion, so I figured that maybe an upgrade to Snow Leopard would smooth over some of the problems.. and that’s when it began locking up almost immediately after booting.

    I swapped out the RAM, trying various combinations of the two original sticks and the two 3rd party sticks. Using just the original RAM made it more stable, but then I tried using just the 3rd party RAM and it was equally as stable, so I don’t know what to make of that. Currently I have all of the RAM in and I’ve been running Apple Hardware Test for about 2 hours without any problems.

    In addition to the cpu stress test you outlined, I tried Cinebench and it got through it several times without freezing. What I need to do now is find a good graphics card stability test (ATI X1900) and do a thorough hard drive check. A few years ago my Windows machine couldn’t go all of 10 minutes without crashing and it turned out to be bad sectors on the HD.

    What are your crash patterns like?

  10. fidel Says:

    Hi Bvac,

    well for me it started with 10.6.3 (first impression)

    My debug problem is that i started playing with other topics at the same time (added a pcie eSATA card & realizing an issue with 2 FB-Dimms.

    Apart from the non-clear source the pattern is as follows:
    * screen goes black
    * computer is no longer accessible via network (ssh etc)

    a quick reboot (lovely) helps usually – while it might jump again into that black-screen mode directly on login (happened 2 times so far)

    In addition – this happens “only” sometimes – so i am far away from being able to reproduce it.

    Regarding your memory tests:
    Have you ever tested memtest86 for osx?

    Best Regards
    fidel

  11. bvac Says:

    I used the memtest available at this page: http://www.command-tab.com/2008/01/11/how-to-test-ram-under-mac-os-x/

    Ran it for a few hours, no incidents. I think what I might try is installing one stick at a time and testing it by itself. But it’s looking more and more like RAM is not the issue for me. Have you tested your video card in any way?

  12. fidel Says:

    Thanks for the link.

    Well – in my case i def. had a trouble-causing RAM – but i don’t think either that was the reason for my issue in general.

    Regarding GFX
    No test at all – to be honest i do not even know a good method to test my card. I guess it’s the same answer for you right?

  13. bvac Says:

    Cinebench has an OpenGL/video card stress test but it says that my card (ATI X1900) doesn’t have the required features to run it. There’s also supposedly a mac version of SPECViewperf but I haven’t been able to find it

  14. fidel Says:

    regarding Cinebech:
    i can start the Cinebech OpenGL Test – but get the following error message during the test

    >> https://dl.dropbox.com/u/223435/public_trash/20100413_210933_ss.jpg

    Pressing ok continues the test but without final result or similar.

    regarding SPECViewperf:
    never heard of – gonna start my search and report if i stumble upon something interesting.

  15. bvac Says:

    Cinebench measures how your video card renders a scene compared to their baseline render, that error only means that the pixels your card renders are not 100% accurate. Running it on a loop as a stress test should still be fine though.

  16. fidel Says:

    yes – it works perfect to generate some stress on the openGL front ;)

  17. MaSlo Says:

    Thanks for the tip, exactly what I needed :)

  18. fidel Says:

    macslo:
    glad to hear that post helped.

    best regards
    fidel

  19. IanC Says:

    bvac, you may or may not find some joy in the “display anomalies” thread. Yours uses the same ATIRadeonX1000.kext driver.

    http://discussions.apple.com/message.jspa?messageID=12493699#12493699

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>