How to create a CPU spike with a bash command

Generate CPU spikes near to 100% load on a Linux machine. You can ran the following command in bash:

To generate cpu spike :

# dd if=/dev/zero of=/dev/null

 

To run the command on put load on more cores run the command:

# fulload(){ dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null &}; fulload; read; killall dd

 

You can also make use of the stress tool “stress”

# stress --cpu 2 --timeout 60

 

To find more about this command go to linux.die.net

 

 

 

Password Reset
Please enter your e-mail address. You will receive a new password via e-mail.

Power by

Download Free AZ | Free Wordpress Themes