Stress Test and Benchmark CPU Performance Debian

In this guide, we want to show you to Stress Test and Benchmark CPU Performance on Debian. It includes Debian versions like Debian 10 Buster, Debian 11 Bullseye, and Debian 12 Bookworm.

You can use Stress Tests and Benchmarks to test the performance of desktop PCs and the server’s CPU. If you want to find hardware problems and system anomalies, it is a good choice to use Stress Test and Benchmark.

How To Stress Test and Benchmark CPU Performance on Debian?

To complete this guide, you must have access to your server as a root or non-root user with sudo privileges. To do this, you can visit the Debian Initials Guides:

Initial Server Setup with Debian 10

Initial Server Setup with Debian 11

And for the newly released Debian 12 Bookworm:

Initial Server Setup with Debian 12 Bookworm

Now follow the steps below to complete this guide.

Step 1 – Benchmark CPU Performance with Sysbench on Debian

Sysbench is a scriptable multi-threaded benchmark tool. It is used for database benchmarks. However, you can use it to create arbitrarily complex workloads that do not involve a database server.

Install Sysbench on Debian

To use sysbench, you must install it on your Debian server. To do this, run the system update with the command below:

sudo apt update

Then, use the following command to install Sysbench:

sudo apt install sysbench -y

Start Benchmark CPU with Sysbench

At this point, you can start benchmark CPU with sysbench by using the command below:

sysbench --test=cpu run

You will get a complete report as shown below:

Output
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Prime numbers limit: 10000

Initializing worker threads...

Threads started!

CPU speed:
    events per second:   703.23

General statistics:
    total time:                          10.0017s
    total number of events:              7036

Latency (ms):
         min:                                    1.29
         avg:                                    1.42
         max:                                   21.29
         95th percentile:                        1.67
         sum:                                 9990.21

Threads fairness:
    events (avg/stddev):           7036.0000/0.00
    execution time (avg/stddev):   9.9902/0.00

The important thing is the “total time” that will be displayed under the “General statistics” to test CPU performance.

Also, you can use the command below:

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.

Output
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 2
Initializing random number generator from current time


Prime numbers limit: 10000

Initializing worker threads...

Threads started!

CPU speed:
    events per second:  1331.75

General statistics:
    total time:                          10.0015s
    total number of events:              13324

Latency (ms):
         min:                                    1.26
         avg:                                    1.50
         max:                                   36.45
         95th percentile:                        1.79
         sum:                                19949.40

Threads fairness:
    events (avg/stddev):           6662.0000/103.00
    execution time (avg/stddev):   9.9747/0.02

Step 2 – How To Stress Test CPU with Stress Tool on Debian?

At this point, you can use Stress Command Tool that leads CPU, memory, and disk input-output stress tests.

Remember that it is not run any benchmark test on your system, instead, it will consistently hammer the CPU and make it run at 100%. 

Note: It is recommended 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.

Install stress tool on Debian

At this point, you need to install stress on your server to start your stress test CPU. To install it, you can use the following command:

sudo apt install stress -y

When your installation is completed, 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.

Step 3 – How To Stress Test CPU with Stress-ng on Debian?

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

Install stress-ng on Debian

At this point, use the command below to install stress-ng on your Debian server:

sudo apt install stress-ng -y

It works as the same stress tool. You have all the warnings and notes mentioned above.

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.

Step 4 – How To Monitor CPU Performance with S-tui on Debian?

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

Install S-tui on Debian

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

sudo apt install s-tui stress

Note: As it is just a terminal-based frontend for the Stress command-line app, be vary of system lock up during high usage.

To start the stress test, run the command below:

s-tui
monitor CPU with s-tui

To stop the test you can press Ctrl + c or close the terminal.

Conclusion

At this point, you have learned to use sysbench, stress, stress-ng, and s-tui tools to Stress Test and Benchmark CPU Performance on Debian. You can easily install these tools on your server and start to test and benchmark your CPU performance.

Hope you enjoy it. Please subscribe to us on Facebook, Instagram, and Twitter.

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!