Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As a fun exercise, what is the best way to maximize the unix CPU load average without actually consuming lots of resources (CPU cycles or memory)?

share|improve this question

closed as not a real question by random May 18 '13 at 3:55

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Via OS-specific mechanisms. – Ignacio Vazquez-Abrams May 18 '13 at 2:58
Let's suppose this is on modern day Linux. – Victor Liu May 18 '13 at 3:00
Why don't you patch the kernel so that it lies about the CPU load average? – Dan D. May 18 '13 at 3:37

2 Answers 2

up vote 0 down vote accepted

This question is covered on Stackoverflow: Artificially modify server load in Ubuntu

share|improve this answer

Last week I wanted to create a backup from my HDD. I mounted it to my old Linux machine and then ran the tar cvjf command to create and compress my HDD. My system has a Celeron CPU which I think is older than 6 years. It's done after 48 hours and the CPU works 99%, but my memory didn't use very much, maybe 50 MB.

Now there are many solutions to your question. Another one is to calculate the factorial of one number (big number).

I've written a simple C program:

#include <stdio.h>
void main() {
    for ( int i = 0; i < 10000000000000; i++);

Then I compiled it with the GCC command, opened 5 terminals and executed them.

This image shows my load average, which is 5. Notice: My program depends on your CPU. I tested it with Pentium M.

enter image description here

share|improve this answer
What I meant was that I didn't want to perform computationally intensive tasks. These examples all peg the CPU. – Victor Liu May 18 '13 at 3:16
Can you please give me an example? – Sepahrad Salour May 18 '13 at 3:18
Well, I can't think of one that doesn't peg the CPU but increases the cpu load average. Hence the question. – Victor Liu May 18 '13 at 3:27
Please read my edited post. Hope this helps. – Sepahrad Salour May 20 '13 at 9:01

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