CPU performance tests with sysbench
sysbench tool
In computing, sysbench is an open-source software tool. Specifically, it is a scriptable multi-threaded benchmarking tool designed for Linux systems. It is a basic command line utility that offers a direct and uncomplicated way to test your system, more …
It comes packaged in most major Linux distribution repositories, it source, how to install and more are availble at github site.
tests example
Bellow tests show result of test sysbench cpu --cpu-max-prime=20000 run done on a workstation with CPU : Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz .
$ sysbench cpu --cpu-max-prime=20000 run
sysbench 1.0.20 (using system LuaJIT 2.0.5)
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Prime numbers limit: 20000
Initializing worker threads...
Threads started!
CPU speed:
events per second: 544.76
General statistics:
total time: 10.0013s
total number of events: 5449
Latency (ms):
min: 1.82
avg: 1.84
max: 2.12
95th percentile: 1.89
sum: 10000.38
Threads fairness:
events (avg/stddev): 5449.0000/0.00
execution time (avg/stddev): 10.0004/0.00
tests compare CPU speed events per second
Bellow comparation of results summary of ‘CPU speed events per second’ done on a few homelab related resources I have.
For one thread test command sysbench cpu --cpu-max-prime=20000 run was used.
For the same test on all available threads command sysbench cpu --cpu-max-prime=20000 --threads=$(nproc) run was used ( nproc returns number of processing units available (https://linux.die.net/man/1/nproc)).
| CPU model name | Number of threads: 1 | Number of threads: all |
|---|---|---|
| 12th Gen Intel(R) Core(TM) i7-1270P | 1590.18 | (16) 13382.93 |
| Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz | 544.76 | (6) 3120.97 |
| Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz | 513.06 | (8) 3046.54 |
| AMD Embedded G-Series GX-420GI Radeon R7E | 363.74 | (4) 1162.31 |
| Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz | 337.47 | (4) 982.76 |
| Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz | 295.23 | (4) 922.38 |
This results along with other tests and factors ( size, powerconsumption, noise ) help me decide which device to use in next project.
more
Sysbench tool may be used to other than CPU test.
RAM performance testing:
sysbench memory run
sequential write (seqwr) performance can be tested:
sysbench fileio --file-test-mode=seqwr run
To explore more options in particular test replace run with help ex.: sysbench memory run help and or read manual man sysbench.