This article will provide you the details about the Sysbench command-line tool. We will discuss how to test the performance of Linux OS components through the sysbench utility as well. We have implemented all commands on the latest available Ubuntu 20.04 system.
Install Sysbench Tool
The sysbench utility can directly be installed from the official Ubuntu repository by running the following command:
Enter “Y” and then press “Enter” to proceed further with the installation.
Perform CPU Benchmarking Using sysbench Tool
To evaluate the CPU performance, use the following command for CPU benchmarking:
The complete report statistics will be displayed on the terminal, but the important thing here is the “total time” that will be displayed under the “General statistics” to test CPU performance.
You can also explore CPU benchmark options using the following command:
The command parameters can be modified based on your requirements. For example, use the following to benchmark the CPU performance:
Benchmark Memory Using the sysbench Tool
To test the Memory performance, type the following basic command on the terminal:
Memory performance can be tested by examining the two parameters, “Total Operations” and data amount transferred.
To test more memory options, use the following command:
Benchmark I/O Using the sysbench Tool
The I/O performance test is a little bit different from the CPU and memory test. In file I/O testing, you need to create a test file that is much larger than your RAM size. The value you can set ”150 GB” is good. The general sequential write I/O performance test can be done using the following command:
Explore more options by using the following command to perform the I/O benchmark:
There are many options shown on the terminal. Just set the values of the parameters based on your requirements and test the performance of the I/O of your Linux system.
Once the performance test is completed, delete the test file by using the following command:
Conclusion
In this tutorial, we have described how to install sysbench utility on a Linux system and how to test the performance of your CPU, memory, and I/O of your system. Try all the above options to get more accurate performance results. Using this tool, you can also test the performance of databases.