Test Disk Performance
Linux
Windows
To fully test the performance of cloud server volumes (read/write IOPS and bandwidth), use the fio utility. You can use test files for testing — prepared text files with test settings.
You can compare the test results with limits for network volumes and local disks.
1. Install the fio utility
-
Install the
fioutility:sudo apt updatesudo apt install fio
2. Prepare the disk for testing
Do not use a disk that contains any information for testing—all data on the disk will be destroyed during preparation for testing.
You can use a separate file on the disk for tests, but the result may not be representative, especially if you are using the root partition.
To eliminate the impact of services and file system performance on the test result, we recommend that you create an empty network volume and fill it with data.
-
View the name of the empty disk:
lsblkA list of cloud server disks will appear in the response. Copy the name of the empty disk.
-
Fill the empty disk with data:
dd if=/dev/urandom of=/dev/<sdX> bs=4MSpecify
<sdX>— the name of the empty volume that you copied in step 3.
3. Test performance
You can use:
- IOPS testing — random write or read with 4 KB blocks;
- bandwidth testing — random write or read with 4 MB blocks.
Test IOPS
Write
Read
-
Open the CLI.
-
Create a test file in the
nanotext editor:nano write.ini -
Add the following content to the test file:
[writetest]size=2000Mblocksize=4kfilename=/dev/sdbrw=randwritedirect=1buffered=0ioengine=libaioiodepth=32Where:
size— total size of the file for testing;blocksize— size of a single data block for testing;filename— path to the file to be used for testing. The example above shows a test with writing to a disk with the parameterfilename=/dev/sdb;iodepth— number of threads.
-
Exit the
nanotext editor and save the changes: press Ctrl+X, and then Y+Enter. -
Run the test:
fio write.iniLook for the IOPS value in the test output. Example output:
write: IOPS=118, BW=475KiB/s (487kB/s)(2000MiB/4310296msec); 0 zone resets
Test bandwidth
Write
Read
-
Open the CLI.
-
Create a test file in the
nanotext editor:nano write.ini -
Add the following content to the file:
[writetest]size=2000Mblocksize=4Mfilename=/dev/sdbrw=writedirect=1buffered=0ioengine=libaioiodepth=32Where:
size— total size of the test file;blocksize— size of a single block with which the read or write operation is performed;filename— file for writing or reading. The examples below show tests with writing to a disk with the parameterfilename=/dev/sdb— writing will also destroy data and the file system on the disk, if any;iodepth— number of threads.
-
Exit the
nanotext editor and save the changes: press Ctrl+X, and then Y+Enter. -
Run the test:
fio write.iniLook for the bandwidth (BW) value in the test output. Example output:
write: IOPS=25, BW=100MiB/s (105MB/s)(2000MiB/19974msec); 0 zone resets