4

I'm looking for a command line application that will artificially burden the CPU. It needs to be better than just a busy loop. We're testing how the system holds up under heat stress and the CPU needs to generate as much heat as possible.

deft_code
  • 205
  • 2
  • 8
  • 3
    A similar question is on superuser. [Linux program to artificially create CPU usage](http://superuser.com/questions/168524/linux-program-to-artificially-create-cpu-usage) – Zoredache Aug 10 '10 at 22:48

3 Answers3

7

I've had good luck with:

dd if=/dev/urandom of=/dev/null bs=1024

It keeps a single thread at 100% CPU. Run multiple times to keep more cores busy. Nice it if you want to.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
  • 3
    +1 .. That is pretty clever I think. – Kyle Brandt Aug 10 '10 at 23:39
  • Very nice usage of what's already on hand. – Skyhawk Aug 11 '10 at 00:06
  • This may keep the CPU busy, but will it really stress it? The various cpu stressing programs for windows seem to try a lot harder than just continually copying memory (maxed out SSE while driving the ALU and FPU). – deft_code Aug 11 '10 at 00:28
  • 1
    @Caspin It's doing more than just copying memory, it's doing quite a bit of computation as well. Doing the same from /dev/zero results in MUCH higher rates than from /dev/urandom, and CPU barely twitches. – sysadmin1138 Aug 11 '10 at 03:19
  • cpuburn is able to heat up the processor more quiekly as well as get it a few degrees hotter. dd 57° C vs burnP6 60° C. – deft_code Aug 11 '10 at 17:21
  • I finally attached a meter to my system to see which method causes the CPU to draw more power (more power == more heat). The burn programs of course win. The surprise is `ls / > /dev/null` draws nearly the same power as the urandom method. – deft_code Sep 02 '10 at 16:27
  • @caspin Good to know! – sysadmin1138 Sep 02 '10 at 16:35
1

Followed Zoredache's link. The question isn't really what I'm looking for. However, the accepted answer mentioned cpuburn.

*** WARNING ***
This program is designed to heavily load CPU chips. Undercooled, overclocked or otherwise weak systems may fail causing data loss (filesystem corruption) and possibly permanent damage to electronic components. Nor will it catch all flaws.
*** USE AT YOUR OWN RISK ***

With a warning like that it's got to be good.
My one concern is it's a bit old. You'd think an app that used some of the new vector processing instructions could do a better job at heating up the cpu.

deft_code
  • 205
  • 2
  • 8
0

In conjunction with sysadmin1138's answer, try adding one of the distributed computing tools like Stanford's Folding@Home (http://folding.stanford.edu)*.

* I run f@h, and it generally keeps my laptop at 170-180F (I only run it when plugged-in, and not on my lap). I suspect it would would do similarly with a server CPU

warren
  • 18,369
  • 23
  • 84
  • 135
  • It's not obvious from my question, but I need this utility to do heat test on an embedded device. While it's being cooked the only input is a serial line to verify the device is still alive. Would f@h run on a machine with no internet access? – deft_code Aug 12 '10 at 15:37
  • 1
    @Caspin, adding the "embedded" requirement definitely changes the scope of good answers :) – warren Aug 13 '10 at 14:06