How to create 100% CPU load in Linux (2024)

Skip to content

Advertisem*nt

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.

    How to create 100% CPU load in Linux (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:How to create 100% CPU load in Linux (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.How to create 100% CPU load in Linux (3)

Voila, you have loaded your CPU at 100%. See the following screenshot:How to create 100% CPU load in Linux (4)

To stop it, execute the command killall yes as root.How to create 100% CPU load in Linux (5)

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. View all posts by Sergey Tkachenko

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

    Reply

  2. Thanks man. Exactly what I was looking for. No need to install additional softwares, simple and works like a charm.

    Reply

Leave a Reply

How to create 100% CPU load in Linux (2024)
Top Articles
Latest Posts
Article information

Author: Kerri Lueilwitz

Last Updated:

Views: 6392

Rating: 4.7 / 5 (47 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Kerri Lueilwitz

Birthday: 1992-10-31

Address: Suite 878 3699 Chantelle Roads, Colebury, NC 68599

Phone: +6111989609516

Job: Chief Farming Manager

Hobby: Mycology, Stone skipping, Dowsing, Whittling, Taxidermy, Sand art, Roller skating

Introduction: My name is Kerri Lueilwitz, I am a courageous, gentle, quaint, thankful, outstanding, brave, vast person who loves writing and wants to share my knowledge and understanding with you.