Sysbench
#
Install Sysbench
#
# Install CPU benchmark
sudo apt update && sudo apt install -y sysbench
List Available CPU Cores
#
# List available CPU cores:
nproc
# Shell output:
4
Run Benchmark
#
# Run CPU benchmark
sysbench cpu --cpu-max-prime=100000 --threads=4 run
# Shell output:
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 4
Initializing random number generator from current time
Prime numbers limit: 100000
Initializing worker threads...
Threads started!
CPU speed:
events per second: 1032.77
General statistics:
total time: 10.0037s
total number of events: 10332
Latency (ms):
min: 3.62
avg: 3.87
max: 18.76
95th percentile: 4.10
sum: 40007.22
Threads fairness:
events (avg/stddev): 2583.0000/27.16
execution time (avg/stddev): 10.0018/0.00
-
--cpu-max-prime=100000
The highest prime number to test
-
--threads=1
Tests single-core performance
-
--threads=4
Tests full CPU usage
-
--threads=8
Tests oversubscription and CPU scheduler behavior