Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Ubuntu 16.04 - CPU Benchmarking

So you just built your new overly-powerful system and want to stroke your ego by benchmarking your system and give the results to others. Here are a few ways to do so:

Similar Posts

Sysbench

This is probably the easiest method.

Installation

sudo apt-get install sysbench

Execution

Run a single threaded test with:

sysbench --test=cpu run

Run a multi-trheaded test by specifying the number of threads (16 in this case) with:

sysbench --test=cpu --num-threads=16 run

Unfortunately, the default "difficulty" was too short for my 16 thread Ryzen 7 system, so I needed to increase the maximum prime with the --cpu-max-prime parameter:

sysbench --test=cpu --num-threads=16 --cpu-max-prime=100000 run

In case anybody is interested, my result for a Ryzen 1700 was:

Maximum prime number checked in CPU test: 100000


Test execution summary:
    total time:                          19.2508s
    total number of events:              10000
    total time taken by event execution: 307.7587
    per-request statistics:
         min:                                 15.66ms
         avg:                                 30.78ms
         max:                                 55.05ms
         approx.  95 percentile:              30.84ms

Threads fairness:
    events (avg/stddev):           625.0000/1.70
    execution time (avg/stddev):   19.2349/0.01

Phoronix Test Suite

The guys over at Phoronix published their test suite and you can use it yourself! In case you didn't know, they are an awesome Linux hardware review/benchmarking blog

Installation

sudo apt-get install phoronix-test-suite unzip -y

Execution

List the possible test suites with:

phoronix-test-suite list-available-suites

The CPU specific ones that I found are:

  pts/chess                        - Chess Test Suite                 Processor
  pts/compilation                  - Timed Code Compilation           Processor
  pts/compiler                     - Compiler                         Processor
  pts/compression                  - Timed File Compression           Processor
  pts/computational-biology        - Computational Biology Test Suite Processor
  pts/cpu                          - CPU / Processor Suite            Processor
  pts/cryptography                 - Cryptography                     Processor

To execute one of the tests run it like so:

phoronix-test-suite run pts/cpu

References

Last updated: 16th August 2018
First published: 16th August 2018