LKBEN11730: How to check the IO speed of your linux system with sysbench?
Symptom
You need to know if your system has become faster after an upgrade.
Cause
This is needed from time to time.
Solution
A relatively easy method to check the performance of your systems IO (= Input Output) can be done with sysbench. There are a lot of possible tests options. To view them, you can run:
sysbench fileio help
You can use the following commands as a baseline for experiments:
#first we need to prepare. rndrw stand for random read and write
sysbench fileio --file-total-size=2G --file-test-mode=rndrw --time=60 --max-requests=0 prepare
#now you run the test
sysbench fileio --file-total-size=2G --file-test-mode=rndrw --time=60 --max-requests=0 run
#without cleanup, you will end up with testdata on your disk!
sysbench fileio --file-total-size=2G --file-test-mode=rndrw --time=60 --max-requests=0 cleanup
All tests need to be prepared. After running you need to cleanup to delete the testdata written to disk.
The preparation will create testtiles.
sysbench fileio --file-total-size=2G --file-test-mode=rndrw --time=60 --max-requests=0 prepare
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)
128 files, 16384Kb each, 2048Mb total
Creating files for the test...
Extra file open flags: (none)
Creating file test_file.0
Creating file test_file.1
Creating file test_file.2
.....
Creating file test_file.126
Creating file test_file.127
2147483648 bytes written in 5.21 seconds (393.35 MiB/sec).
The test will present the results:
sysbench fileio --file-total-size=2G --file-test-mode=rndrw --time=60 --max-requests=0 run
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Extra file open flags: (none)
128 files, 16MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...
Threads started!
File operations:
reads/s: 1304.22
writes/s: 869.48
fsyncs/s: 2783.70
Throughput:
read, MiB/s: 20.38
written, MiB/s: 13.59
General statistics:
total time: 60.0339s
total number of events: 297494
Latency (ms):
min: 0.00
avg: 0.20
max: 18.04
95th percentile: 0.75
sum: 59893.10
Threads fairness:
events (avg/stddev): 297494.0000/0.00
execution time (avg/stddev): 59.8931/0.00
The cleanup just writes "Removing test files...".
Hope this helps.
Disclaimer:
The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!About the Author
Author:
- Keskon GmbH & Co. KGWim Peeters is electronics engineer with an additional master in IT and over 30 years of experience, including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform.
Latest update: 08/07/2024