Advertisement

How to create 100% CPU load in Linux

Sometimes it is useful to stress out your CPU. For example, if you have replaced your CPU fan or changed something in the cooling system, it is a good idea to test it under heavy load. Here is a trick you can use to overload your CPU in Linux.

One of great options of the Linux operating system is the amount of useful tools available out of the box even in the base system. Thanks to the "everything-is-a-filesystem" concept used when designing Linux, you don't need extra tools to stress out your CPU.

How to create a 100% CPU load in Linux

To create a 100% CPU load on your Linux PC, do the following.

  1. Open your favorite terminal app. Mine is xfce4-terminal.
  2. Identify how many cores and threads your CPU has. You can get detailed CPU info with the following command:
    cat /proc/cpuinfo

     

    It prints out information about all CPUs, including physical and virtual.

    cpu-info-1
    Notice the "Processor" line for every information section. It has a value starting from 0 and ending at the number of cores/threads. In my case, it shows 4 CPUs, which matches my dual core i3 with 2 threads per core.

    Alternatively, you can use something like the htop utility, it shows the same information using bars:cpu-info-2

  3. Next, execute the following command as root:
    # yes > /dev/null &

    Repeat the command N times, where N is the number of CPUs. In my case, I have to execute it four times.create-cpu-load-linux

Voila, you have loaded your CPU at 100%. See the following screenshot:100-percent-load

To stop it, execute the command killall yes as root.cancel-test

That's it.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

2 thoughts on “How to create 100% CPU load in Linux”

  1. That’s brilliant. Thank you. I have been using stress-ng but that package is not supported on Photon OS. This is perfect.

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.