Skip to main content
Test disk performance
Last update:

Test disk performance

To fully test 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 the limits for the local disks и network drives.

Install the fio utility

  1. Connect to the server.

  2. Install the utility fio:

    sudo apt update
    sudo apt install fio

Prepare the disk

carefully

Do not use this command for disks that contain any information — the command will destroy all data on the disk. The examples below show tests with writing to disk with filename=/dev/sdb — writing will also destroy data and file system on the disk, if any.

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:

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

You can use a file for tests, but the result may not be representative, especially if you are using a root partition.

Test performance

Select a test:

Test Parameters:

  • 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.

Random recording in 4KB blocks

  1. Create a test:

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

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

    fio write.ini

    In the test output, look for the IOPS value:

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

Random recording in 4 MB blocks

  1. Create a test:

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

    [writetest]
    size=2000M
    blocksize=4M
    filename=/dev/sdb
    rw=randwrite
    direct=1
    buffered=0
    ioengine=libaio
    iodepth=32
  3. Run the test:

    fio write.ini

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

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

Random reading in 4KB blocks

  1. Create a test:

    nano read.ini
  2. Add content to the file:

    [readtest]
    size=2000M
    blocksize=4k
    filename=/dev/sdb
    rw=randread
    direct=1
    buffered=0
    ioengine=libaio
    iodepth=32
  3. Run the test:

    fio read.ini

    In the test output, look for the IOPS value:

    read: IOPS=320, BW=1280KiB/s (1311kB/s)(2000MiB/1599899msec)

Random reading in 4 MB blocks

  1. Create a test:

    nano read.ini
  2. Add content to the file:

    [readtest]
    size=2000M
    blocksize=4M
    filename=/dev/sdb
    rw=randread
    direct=1
    buffered=0
    ioengine=libaio
    iodepth=32
  3. Run the test:

    fio read.ini

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

    read: IOPS=25, BW=100MiB/s (105MB/s)(2000MiB/19911msec)