Install Sysbench on Ubuntu 20.04

Sysbench is an open-source tool which allows to benchmark system by performing various tests for CPU, RAM, disk I/O and database (e.g. MySQL).

This tutorial shows how to install Sysbench on Ubuntu 20.04.

Install Sysbench

Add the Sysbench repository:

wget -qO - https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | sudo bash

Install Sysbench:

sudo apt install -y sysbench

When installation is completed, we can check Sysbench version:

sysbench --version

Testing Sysbench

The following command can be used to evaluate the CPU performance:

sysbench cpu run

Command will output performance results:

...........
CPU speed:
    events per second:  1217.12

General statistics:
    total time:                          10.0009s
    total number of events:              12174

Latency (ms):
         min:                                    0.78
         avg:                                    0.82
         max:                                    2.02
         95th percentile:                        0.94
         sum:                                 9996.31

Threads fairness:
    events (avg/stddev):           12174.0000/0.00
    execution time (avg/stddev):   9.9963/0.00

We can also test RAM performance:

sysbench memory run

We can test various disk I/O operations. For example, sequential write (seqwr) performance can be tested using the following command:

sysbench fileio --file-test-mode=seqwr run

Uninstall Sysbench

If you wish to completely remove Sysbench and related dependencies, execute the following command:

sudo apt purge --autoremove -y sysbench

Remove GPG key and repository:

sudo apt-key del 04DCFD39
sudo rm -rf /etc/apt/sources.list.d/akopytov_sysbench.list

Leave a Comment

Your email address will not be published. Required fields are marked *