How to Stress Test CPU in Linux

Want to stress test your CPU in Linux? Here's how you can do it effortlessly.
Warp Terminal

Stress testing your CPU is one of the best ways to check your processor's performance capabilities under heavy load and the system's temperature when that happens.

When you stress test the CPU, you can monitor the system's resources to see how they behave with the CPU at its peak workload. While the performance will not change compared to what the processor is capable of, the temperature may affect its operation if it is not well-equipped.

Stress testing is essential for enthusiasts when building a new system, especially if you plan to overclock the CPU later.

For instance, if your CPU gets too hot too quickly during the stress test. You need a better cooling solution by changing the CPU cooler, using a better airflow cabinet, etc.

Now that you have an idea about the benefits, I will walk you through the following ways to stress test the CPU in Linux:

  • Using GtkStressTesting (GUI method)
  • Using stress and s-tui utility (CLI method)

So let's start with the first one.

Stress test Linux CPU using GUI method πŸ–₯️

If you prefer using a GUI solution over the terminal, I have just the easiest method for you to stress-test your system. Β 

There is a GUI utility GtkStressTesting, which helps you stress test and monitor temperature simultaneously. It provides various presets to stress-test the system and provides an ability to choose how many cores you want to work with during the test.

🚧
This tool is no more actively maintained on GitLab. But it works as expected.

GtkStressTesting is available as a Flatpak, so if you haven't already enabled Flatpak support, refer to our Flatpak setup guide.

Once you have enabled Flatpak support, the GtkStressTesting utility can be installed using the following via the terminal (if not software center)

flatpak install flathub com.leinardi.gst

After the installation, you can start the GtkStressTesting utility from the system menu.

Here, I would recommend you click on the Read all button and enter the sudo password so the utility can fetch all the information of your system:

Allow read all premissions for GtkStressTesting

From here, you can choose how long you want to stress test your system (you can always stop the process if the temp gets too high) and choose the max number available in the Workers: Auto.

I went for 12 cores and 5 mins of stress testing:

choose time and cores to stress test the CPU in linux
(Click to enlarge image)

Once you are done, click on the start button and monitor the temperatures, and if they reach beyond 90, stop the stress testing.

My system went to 85 max during stress testing:

stress test Linux CPU usng GUI

Pretty easy way to stress test the CPU. Isn't it? πŸ˜‰

Stress test Linux CPU using the Terminal

stress test using s-tui command utility

You'd need two utilities to stress test using a terminal: s-tui and stress.

You can get these tools installed from the default repositories or using pip. It is easier with default repositories if you are okay with using an older version of the tool (a tad bit).

Here are the commands that will help you install them on popular Linux distros:

For Ubuntu/Debian base:

sudo apt install s-tui stress 

For Arch Linux:

sudo pacman -S s-tui stress

For Fedora/RHEL:

sudo dnf install s-tui stress

If you want to use pip for the latest version, here is the command:

pip install s-tui --user

Once you are done with the installation, launch the s-tui utility in the terminal:

s-tui

And you would be met with the following:

monitor clock speed, load and CPU utilization in Linux

You can use the mouse or keyboard arrow keys to navigate through the menu, so click on the Stres options and choose how long you want to stress test the system (in seconds):

set time for how long to stress test CPU in Linux
(Click to enlarge image)

And finally, select the Stress option, and it will start the stress testing for a specified period:

stress test Linux CPU using terminal
(Click to enlarge image)

And if the temperature gets out of control, you can click on the Quit button to stop the stress test manually. Additionally, if you want to store the data in the .csv format, the tool gives you the feature.

To store the data, all you have to do is append the -c flag while starting the s-tui utility as shown:

s-tui -c

And if you want to save the file with a name to your liking, you'd have to use the --csv-file flag as shown:

s-tui --csv-file <name of file>.csv

For example, here, I named the file Hello.scv:

s-tui --csv-file Hello.scv

You can explore more about the tool on its GitHub page.

Suggested Read πŸ“–

7 System Monitoring Tools for Linux That are Better Than Top
Top command is good but there are better alternatives. Take a look at these system monitoring tools that are similar to top, but better than it.

Happy System, Happy Life 😁

Not every user realizes the benefits of a stress test. Sometimes it scares them off with the idea of their system reaching its limits for no reason.

However, the test will help you quickly evaluate and monitor your system's condition. Things like abnormal temperature spikes and CPU being unable to handle what it is should help you identify hardware issues early on.

In either case, you can refer to our temperature monitoring resource if you want to keep your CPU monitor in check without performing stress tests.

How To Check CPU Temperature in Ubuntu Linux
This quick tutorial shows you how to check the CPU temperature on Ubuntu and other Linux distributions with a help of a tool called Psensor. Overheating of laptops is a common issue one faces these days. Monitoring hardware temperatureΒ may help you diagnose why your laptop is getting overh…

You can also check out some of the system monitoring tools or htop alternatives for Linux to keep an eye on your system resources.

πŸ’¬ What do you think about stress testing your CPU in Linux? Do you think we should do it? Share your thoughts on it in the comments below.

About the author
Sagar Sharma

Sagar Sharma

A software engineer who loves to write about his experience with Linux. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.