How to do Performance testing of Linux machines – Sysbench

Reading Time: 3 minutes

Amazon Web Service provides on-demand cloud infrastructure on pay model. The AWS has many services that have made this IT world a flexible and complexity solving place . One of this is AWS.

A very well known service is EC2 .

To all those reading this blog probably know about EC2. It stands for Elastic compute cloud.These are basically virtual compute platforms with all the configurations with various processor .It provides scalable computing capacity in the AWS cloud. 

Instance type

Instance types are group of family according to their use. For example :- t1.micro, t2.micro, t3.micro etc.

Now to evaluate performance there is an open source tool Sysbench which helps to compare these instance types.

What is Sysbench ?

Sysbench is an open-source and multi-motive benchmark software that evaluates the parameter functions assessments for CPU, memory, I/O, and database (MySQL) performance.

How to install Sysbench ?

To install sysbench follow the below steps.

1 – Run the below command to install in your system.

curl -s | sudo bash

2- Then install using the below command.

sudo apt -y install sysbench

So the above image shows installation part and version of the sysbench.

To perform CPU benchmark using sysbench.

Using sysbench tool we can find the CPU performance . The complete report statistics is displayed on the terminal of the cpu usage.

sysbench --test=cpu run
CPU benchmark using Sysbench

The above image shows the evaluation of cpu usage.

The above statistic shows total time , total number of events and events per second. Now this can help in comparing the processing of different instances once installed in all.

For instance the comparison table is as shown below.

Total time10.0013s10.0012s10.0002s10.0003s10.0003s
Events per second796.05768.84987.921205.662930.10
Total no. of events7963769198811205929306
Instance CPU benchmarking

In the above table we can find the comparison between different instance types. Few points to be noted are :

  • The important value is number of events processed.
  • Secondly important value is events per second.
  • The t2 type is showing a decrease from its predecessor.
  • The best performance can be seen by t4g as it shows the best performance among all.

To Perform Memory Benchmark using sysbench

In this the operation per second shows the performance of memory . Now looking at the statistic t3 type is much more good than others. Lets look at the memory benchmark of our system. The t3 is superior in terms of memory performance.

In the above figure it runs the memory test in comparison with the folllowing :

block size: 1KiB
total size: 102400MiB
operation: write
scope: global

So it shows how excellent is sysbench at performing the execution.

EC2 instance comparison on basis of Memory benchmark.

Total time10.0013s10.0013s10.0013s10.0013s10.0013s
Operation per second3655555247157.8444161414.9244389217.6645452545.10
Total no. of events3655555247157441614144438921745452545
Instance type comparison on memory benchmark.

In the above comparison the following points is to be noted:

  • The Mib/sec is the good observant of the memory.
  • In this t3 is superior in performance.

File I/O Benchmarking using sysbench.

This test writes 128 files of 16MB each, to total up to 1.5GB.When supplying the file-total-size switch to the command, sysbench now writes 128 files of 800MB each, making a total of 19780GB. As can be seen, the average performance of the machine is 352863 /0.00.

The below is the output of the benchmark on file input and output.

Benchmark of file I/O.

So to get the benchmark use the below command.

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

Now the above command gives the above output.To get more values just set the values of parameter based on the requirements and can test the I/O of machine.

Deleting the test file.

Once the above test is complete you can delete the test file by below command.

sysbench --test=fileio --file-total-size=100G cleanup

The above command will delete all the test file.


Well to conclude the best way to select instances and machine is using sysbench. It helps to compare the performance. Also the different machines show up the different capacity of performance.So sysbench helps to show up the performance of different machines.


For more information you can visit the following link:-


Written by 

Rishivant is a enthusiastic devops learner at Knoldus. He believes in going 1% up everyday and showcases his learning in his work.

Leave a Reply