DevTech101

DevTech101

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.

:(){:|:&};:
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
%d bloggers like this: