Easy, Fast, Cheap Way to Generate CPU Load? 158
jsailor asks: "A large client and their engineering team will be evaluating cabinets and their ability to cool high density blade server deployments. Some of these systems can consume upward of 21 kW per rack and accordingly require a lot of airflow and/or liquid systems to cool. The systems actively monitor heat conditions, increase airflow rates, and can throttle CPU speeds if necessary. What we need is an easy, fast, and cheap way to run the 2-way and 4-way blades at or near peak CPU utilization for extended periods of time so thermal analysis can be performed. Ideally, we would be able to boot them off a CD and have some means of monitoring the CPU on each or even setting the level of CPU utilization we'd like them to run at. Please note that we do NOT need to simulate a real world application and disk and network access are not of much concern. While running your favorite compute-intensive project is a nice idea, we need something simple so I've come to the Slashdot community for assistance. What are your thoughts?"
How about these? (Score:5, Informative)
EDIT.COM (Score:5, Funny)
Back in the day, the old MS-DOS editing program, EDIT.COM, ran a polling loop that would drive the CPU up to 100%.
The Intel guys used to recommend it as a way to stress test your system.
while true; do true; done (Score:5, Informative)
Re:while true; do true; done (Score:3, Informative)
while true; do
otherwise the shell built-in is used and not fork is executed.
Re:while true; do true; done (Score:3, Informative)
I actually tried to check this, but obviously I was too lazy; bash(1) doesn't seem to list true as built-in, but checking (by renaming /bin/true indeed confirms that you are right).
Sorry about that.
Re:while true; do true; done (Score:2)
I would think that something like Prime95, while larger, would be better.
Your method will exercise a small portion of the ALU. Prime95 will pump up the RAM, and floating-point unit. More transistors switching = more heat!
Re:while true; do true; done (Score:2)
Tried it. Got 30% on one instance and 17% each for up to 8 instances (when I stopped). Plenty of remaining space to run many instances of this loop.
OS & tools: Linux: Fedora Core 3 with latest updates.
Hardware: P4 3ghz with hyperthreading enabled.
Re:That's way too much typing. (Score:2)
Also you end up running out of memory with all the processes and grinding to a halt as you move to swap space. So CPU utilization is not going to be 100% since you're waiting on the disk.
Re:How about these? (Score:2, Informative)
So simple. (Score:5, Informative)
for cpu in 1 2 3 4; do
( while true; do true; done ) &
done
If you want to exercise the disks a bit too, replace the middle line with:
( while true; do find / -type f -exec cp {}
Re:So simple. (Score:2)
while
Unless you can provide some example of true becoming false in the while loop; you would never get 4 forks this way.
Re:So simple. (Score:3, Informative)
Re:So simple. (Score:2)
for cpu in 1 2 3; do
( while true; do true; done ) &
done
SO the parent's solution this is the best solution for this.
Re:How about these? (Score:5, Informative)
The utility is designed to run instruction loops which require the most POWER CONSUMPTION from the cpu and thus generate the most heat. There are versions tuned from pentiums up to current CPU's. There is also a version designed to cause your ram to use the maximum amount of power it can.
Unlike running any old utility that gives you "100% cpu load" such as the comments about running 'true' in an endless loop presented in this thread, cpuburn is actually targeted at generating heat, power, and system stress. 100% processor utalization does not necessarily mean that you are stressing a computer.
Unsuprisingly, many times cpuburn will often cause a computer that you believe is fine and works properly 100% of the time to hard lock after only a couple of minutes. Over time, dust builds up; fans get slower and give out, etc. and a computer with an adequate cooling solution a year ago may not be able to take the heat anymore. CPUBurn can reveal that. It is a very very good utility.
Linpack (Score:2, Interesting)
A Heater. (Score:1, Interesting)
Endless fork? (Score:4, Funny)
#!/bin/sh
sh $0
or in c
while ( 1 )
fork();
Re:Endless fork? (Score:1)
Re:Endless fork? (Score:2)
Re:Endless fork? (Score:2, Interesting)
Flash ads (Score:5, Funny)
Re:Flash ads (Score:3, Funny)
Animated. GIF. Smileys.
Other people use their processing cycles to find puslars. Me? I use mine to have little yellow smiley faces chase each other around with machine guns.
quite simple (Score:3, Interesting)
A little hack someone showed me a while ago. Just set that in the startup script and away you go! Eats up memory and CPU time, so you'll end up with a very very high load and disk activity to boot.
Re:quite simple (Score:2, Informative)
So you might want to expand that to
while [
so when this happens:
"sh: xrealloc:
It just restarts it. (Hmm, the comment appears to be formatted correctly for the command).
POVRay (Score:2, Informative)
Re:POVRay (Score:2)
here you go (Score:2)
{
for (int i=0; 1; i++)
}
Re:here you go (Score:3, Funny)
int main() { for(
Re:here you go (Score:2)
Cat got your tongue? (something important seems to be missing from your comment
Re:here you go (Score:2)
Re:here you go (Score:2)
#define ever
int main() {for(ever);}
But again, infinite loops that do nothing tend not to generate significant amounts of heat anyway.
Microsoft's jvc.exe would skip that. (Score:2)
Back in the day, Microsoft used to write a nifty little Java "compiler" called jvc.exe [to differentiate itself from Sun's javac.exe] - this was back before Sun sued them over their Java implementation.
Anyway, jvc.exe in combination with Microsoft's java.exe had the uncanny ability to spot empty loops like that and jump write over them.
[Which, no doubt, did not bring pleasure to the ghost of poor ol' Alan Turing...]
Re:Microsoft's jvc.exe would skip that. (Score:2)
Also, if the result is always the same, they will precompute it and remove the loop.
Re:Microsoft's jvc.exe would skip that. (Score:2)
Because some programmer may be using the loop as a quick and dirty delay.
That's what I heard anyway, haven't bothered testing that.
A DEC ForTran compiler turned one of those... (Score:2)
Re:here you go (Score:2)
Put your cycles to good use (Score:2)
You want load? (Score:4, Funny)
First, make it into a server (Score:2, Funny)
Distributed.Net, surely. (Score:4, Insightful)
openssl benchmark (Score:4, Informative)
> while true ; do openssl speed ; done
Doing md2 for 3s on 16 size blocks: 511846 md2's in 3.00s
Doing md2 for 3s on 64 size blocks: 278228 md2's in 3.00s
Doing md2 for 3s on 256 size blocks: 98836 md2's in 3.00s
Doing md2 for 3s on 1024 size blocks: 27645 md2's in 3.00s
Doing md2 for 3s on 8192 size blocks: 3574 md2's in 3.01s
[... continues
-molo
Re:openssl benchmark - SMP version (Score:1, Informative)
Distributed projects (Score:5, Insightful)
Re:Distributed projects (Score:2)
Re:Distributed projects (Score:2)
It's available here [stanford.edu]
Gentoo (Score:5, Funny)
Re:Gentoo (Score:2)
that should keep things busy for a while.
Prime95, as the overclockers use. (Score:5, Informative)
Re:Prime95, as the overclockers use. (Score:3, Informative)
Re:Prime95, as the overclockers use. (Score:2)
Infinite loop (Score:1)
int x=1;
while (1=1) {
x++;
}
return 0;
}
That's one sure fire way to spike CPU usage.
Re:Infinite loop (Score:2)
Re:Infinite loop (Score:2)
Try seti@home or something similar. That would do much more than just a tight - relatively efficient loop.
A
Fractals (Score:2)
good ol' Hiren's (Score:2, Informative)
And if you don't like that, you can try Knoppix bootable CD. It has (i think) multi-CPU support and you can most likely find
Easy, Fast Way to Generate CPU Load (Score:5, Funny)
easy as a b C (Score:1)
loop.c (Score:1, Redundant)
{
while(true)
{}
}
Just have it calculate pi... (Score:2)
Come on.. (Score:2)
main() {
a = 0;
for (;;) {
double a;
a *= 1.00001;
}
}
Re:Come on.. (Score:2)
fredegar vogel $ cc -Wall -g slashdot.c
slashdot.c:1: warning: return type defaults to `int'
slashdot.c: In function `main':
slashdot.c:2: error: `a' undeclared (first use in this function)
slashdot.c:2: error: (Each undeclared identifier is reported only once
slashdot.c:2: error: for each function it appears in.)
Re: (Score:2)
How about Netbench? (Score:3, Interesting)
LAPACK et. al. (Score:2)
That's what they use to spec and rank supercomputers. It'll burn, burn, burn!
Re:LAPACK et. al. (Score:2)
LinPack [netlib.org] also exists. From Linpack's website, "LINPACK was designed for supercomputers in use in the 1970s and early 1980s. LINPACK has been largely superceded by LAPACK, which has been designed to run efficiently on shared-memory, vector supercomputers."
But, dude, why the hate? These are subroutines that solve specifically defined linear algebra problems. They happen to consume a large amount of cpu time for large scale problems. So why the reply? Or are you just trying to flamebait?
Re:LAPACK et. al. (Score:2)
It's the older one. LAPack is the newer one. I still don't understand why you're ranting about this.
Uh, the program could be very simple. Create a randomized A matrix (1 million x 1 million). Create a randomized b matrix (1 million). Solve for x, Ax=b, using LAPACK. If that's too difficult for the guy, then maybe he shouldn't be in charge of a major computing center. Or he can tell someone else to do it.
Solving it (using Gaussian elim or another of LAPACK's su
Re:LAPACK et. al. (Score:2)
And the reason why you chimed in is because you're probably bored, an **hole, and have nothing else to do.
My last reply.
Merseinne Prime (Score:1)
Seti@Home is another alternative along the same lines, although Seti will utilize more Hard drive. (Signal processing vs huge Mathematical algorithm).
The Ultimate Bootable CD (Score:2)
Burn it to a DVD and it will load even faster.
md5sum (Score:3, Interesting)
Re:md5sum (Score:2)
Remember the disks too (Score:3, Insightful)
Disk drives generate heat (and fail first from it). To keep your drives excercised, check out Bonnie [garloff.de].
This is easy (Score:2)
Easiest way (Score:1, Funny)
Re:Easiest way (Score:3, Funny)
bc and ^ (Score:2)
bc
1234123412341234^1234123412
Should work for at least an hour or two on current CPU's.
gzip (Score:5, Informative)
Boot any linux liveCD that supports your hardware, and run the following command:
cat
Sould eat one whole CPU and run forever. If you have an SMP machine, run one instance of that per CPU, and you should max out. The system should still remain responsive enough that you can terminate the processes at will, even though the CPU is at 100% usage.
I would try to pick a liveCD that does not bother starting X since that just adds to the boot time.
You may want to consider the heat generated by components other than the CPU. Hard drives put off a significant amount of heat, as do memory and video, and to a lesser extent network hardware.
To utilize a lot of memory as well as CPU, you might look for something like a prime-factoring program. (prime seives love to eat memory)
For video heat, try something like an unlimited framerate demo in Quake 2. (I think there is even a Linux port)
For network load, just use a ping utility that supports flood-ping and arbitrary payloads. Then floodping yourself or something on the LAN with huge packets.
For hard drive heat, you could just dd
Another option (Score:2)
The actual download page is here [sourceforge.net]
Kernel compiles! (Score:2)
Re:Kernel compiles! (Score:2)
I was about to, and saw your post when making sure I wouldn't be modded redundant. It's the best method I've found to stress-test your CPU and memory subsystem. In particular, do a make -j to compile in parallel, and use all your CPUs. Be careful, though, the 2.6 kernel will drive your load up to about 80 if you don't restrict it.
I've previously used the kernel-compile trick to test processor stability (when overclocking). Comp
Re:Kernel compiles! (Score:2)
For the curious, this was on a dual opteron with 8 gig of ram.
Ah, doing a ^C got it back... here's top output on its way down:
Re:Kernel compiles! (Score:2)
Damn you!
And here I'd just convinced myself I didn't *really* need to upgrade my main test system yet!
Argh...
Slashdot community is simple (Score:3, Funny)
Thanks! I think...
Folding@HOME! (Score:2)
Sounds like you got some serious, serious horsepower, so I can't resist asking! ;-)
It's not so easy (Score:4, Insightful)
Modern CPUs are complicated beasts, with multiple execution units, deep pipelines and big caches. And they're connected to big external memories and disk drive arrays. If you want to stress-test the cooling system, then you need code that keeps all the execution units and all the pipelines and the caches and main memory and the disk array all going full blast. That's not as easy as it sounds. Intel has mentioned various test programs that they use when thermally testing their CPUs, but I don't know that they've ever released them. Perhaps they're afraid they'd might cause damage, and they'd have to deal with a lot of irate customers.
Re:It's not so easy (Score:2)
Again, these things have to be carefully constructed to load up everything. It's almost impossible in any real application -- something always seems to bottleneck well before everything else -- and with the architectural complexities of today's CPUs, probably only a little easier to do in a test designed merely to load everything up without accomplishing any useful work.
Goin for da gold (Score:2, Funny)
Perl (Score:2)
This will suck up all the CPU for one processor, add the number of processes to run on the end of the command line to load multiple CPUs.
Simulations (Score:2)
I have a few simulations that are taking upwards of 48 hours each to run on puny Athlon 1300s. I could load your systems for a couple hours. :-)
Easy, CPUBurn (Score:2)
Run x instances, where x is the number of CPUs in your machine.
As easy as that.
small, cool, little iso (Score:2, Informative)
- Uses of some utitlities like: stress, cpuburn, hddtemp, lm_sensors, smartmontools
- Dedicated to users who want to test their systems entirely on high load and monitoring their health.
http://www.stresslinux.org/ [stresslinux.org]
You need stress (Score:3, Informative)
http://weather.ou.edu/~apw/projects/stress/ [ou.edu]
I use it at work for testing all of our servers. You have the option of testing CPU, Memory, IO, or VM, and it will most certainly put a heavy load on the server.
File compression (Score:2)
It was so obvious and I missed it. (Score:2)
AMD-based solution (Score:2)
1. Get 10-20 older Athlon boxes.
2. Put them in the same room with the blade servers you want to test.
(3. And do I need to add this step - profit!)
Re:Fact(-1) (Score:2)
if memory serves, factorial(x) is undefined on x (unsigned int) -1 wouldn't take a nice long time...
Re:hmmph (Score:2)
Re:hmmph (Score:2)
Re:Here's a good one... (Score:2)
Re:infinite loop in java (Score:3, Funny)