<p>I have a <a href="http://en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux" rel="noreferrer">RHEL</a> box that I need to put under a moderate and variable amount of CPU load (50%-75%).</p>

<p>What is the best way to go about this? Is there a program that can do this that I am not aware of? I am happy to write some C code to make this happen, I just don't know what system calls will help.</p>

You can probably use some load-generating tool to accomplish this, or run a script to take all the CPU cycles and then use
nice
and
```
renice
```
on the process to vary the percentage of cycles that the process gets.
Here is a sample bash script that will occupy all the free CPU cycles:
```
```
#!/bin/bash
while true ; do
true
done
```
```