Stress tests and benchmark CPU performance in Ubuntu

In this article, we want to teach you about the stress tests and benchmark CPU performance in Ubuntu. It consists of all versions of Ubuntu Like Ubuntu 20.04, Ubuntu 18.04, Ubuntu 22.04, etc., and lists variable utilities of them.

Stress tests and benchmark CPU performance in Ubuntu

Benchmark and stress tests are used to test the performance of desktop PCs and the server’s CPU. They are also a good way in finding hardware problems and system anomalies.

Sysbench

sysbench is a scriptable multi-threaded benchmark tool based on LuaJIT. It is most frequently used for database benchmarks, but can also be used to create arbitrarily complex workloads that do not involve a database server.

Install sysbench (benchmark) in Ubuntu

To install sysbench in Ubuntu run the following command:

sudo apt install sysbench

To start a benchmark with sysbench run the following command:

sysbench cpu --threads=2 run

In your output, you can see CPU speed and you can test your CPU performance with the “events per second” variable.

Stress

Stress is a simple command that leads CPU, memory, and disk input-output stress tests.

Install stress (stress tests) in Ubuntu

You can install stress in Ubuntu with the following command:

sudo apt install stress

Note: Stress will not run any benchmark test on your system, instead it will consistently hammer the CPU and make it run at 100%. You are advised to close all the running apps before doing a test. Running Stress for a longer period can crash the system and you may need to do a hard reboot to recover the system.

You can start the stress test with the following command:

stress --cpu 2

Note: Number 2 refers to the number of threads used for performing the test.
To stop the test you can close the terminal or press ctrl + c to stop the command.

Stress-ng

Stress-ng is an updated version of stress it is much more advanced.

Install stress-ng (stress test) in Ubuntu

You can install stress-ng in Ubuntu with the following command:

sudo apt install stress-ng

Note: we have the warning as mentioned above for this tool too.

You can start the stress-ng test with the following command:

stress-ng --cpu 4

To stop the test you can close the terminal or press ctrl + c to stop the command.

S-tui

s-tui is a terminal UI for monitoring your computer. s-tui allows monitoring CPU temperature, frequency, power, and utilization in a graphical way from the terminal.

Install S-tui in Ubuntu

You can install s-tui in Ubuntu with the following command:

sudo apt install s-tui stress

Note: As it is just a terminal-based frontend for Stress command-line app, be vary of system lock up during high usage.
Type s-tui to start the test. To stop the test you can press Ctrl + c or close the terminal.

Conclusion

These are some of the apps that can run CPU benchmarks on your system.
Hope you enjoy this article about the Stress tests and benchmark CPU performance in Ubuntu.

You might be interested in these articles on the orcacore website:

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

POPULAR TAGS

Most Popular