Linux, Solaris, Docker, Zones – CPU hog load test

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

A controlled CPU HOG load test – Change the number to the number of CPU's

#!/usr/bin/perl
 
print "Eating the CPUs\n";
 
foreach $i (1..16) {
    $pid = fork();
    last if $pid == 0;
    print "Created PID $pid\n";
}
 
while (1) {
    $x++;
}

Another form of loading all cpu’s, might not work in latest Linux bash releases

Note: Make sure you are not running anything important on the system (docker or zone), as it will max all cpus.

:(){:|:&};:

Leave a Reply

avatar
3000
  Subscribe  
Notify of