Skip to main content
Test disk performance

Test disk performance

For complete testing of cloud server disk performance (read and write IOPS and throughput), use the utility fio. For testing you can use file tests — prepared text files with test settings.

  1. Install the fio utility.

  2. Prepare the disk for testing.

  3. Test performance.

Test results can be compared to network disk limits and local disks.

1. Install the fio utility

  1. Connect to the server.

  2. Install the utility fio:

    sudo apt update
    sudo apt install fio

2. Prepare the disk for testing

carefully

Do not use a disk that contains any information for testing — all data on the disk will be destroyed in 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 a root partition.

To exclude the influence of services and file system performance on the test result, we recommend the following create an empty network drive and fill it with data.

  1. Create a blank disk.

  2. Connect the disk to the cloud server.

  3. Look at the name of the blank disk:

    lsblk

    A list of cloud server disks will appear in the response. Copy the name of an empty disk.

  4. Fill the empty disk with data:

    dd if=/dev/urandom of=/dev/<sdX> bs=4M

    Specify <sdX> — name of the blank disk that you copied in step 3.

3. Test performance

Can be used for:

Test IOPS

  1. Open the CLI.

  2. Create a test file in a text editor nano:

    nano write.ini
  3. Add content to the test file:

    [writetest]
    size=2000M
    blocksize=4k
    filename=/dev/sdb
    rw=randwrite
    direct=1
    buffered=0
    ioengine=libaio
    iodepth=32

    Here:

    • size — total file size for testing;
    • blocksize — size of one block of data for testing;
    • filename — path to the file to be used for testing. The example above shows a test with writing to disk with the parameter filename=/dev/sdb;
    • iodepth — number of streams.
  4. Exit the text editor nano while saving changes: press Ctrl+Xand then Y+Enter.

  5. Run the test:

    fio write.ini

    In the output of the test, look at the IOPS value. Example output:

    write: IOPS=118, BW=475KiB/s (487kB/s)(2000MiB/4310296msec); 0 zone resets

Test throughput

  1. Open the CLI.

  2. Create a test file in a text editor nano:

    nano write.ini
  3. Add content to the file:

    [writetest]
    size=2000M
    blocksize=4M
    filename=/dev/sdb
    rw=randwrite
    direct=1
    buffered=0
    ioengine=libaio
    iodepth=32

    Here:

    • size — total size of the test file;
    • blocksize — the size of one block with which a read or write operation is performed;
    • filename — file to write or read. The examples below show tests with writing to disk with the parameter filename=/dev/sdb — write will also destroy the data and file system on the disk, if any;
    • iodepth — number of streams.
  4. Exit the text editor nano while saving changes: press Ctrl+Xand then Y+Enter.

  5. Run the test:

    fio write.ini

    In the test output, look at the throughput (BW) value. Example output:

    write: IOPS=25, BW=100MiB/s (105MB/s)(2000MiB/19974msec); 0 zone resets