---
title: "Test Disk Performance"
sidebar_label: "Test Disk Performance"
sidebar_position: 4
hide_table_of_contents: true
description: "How to test cloud server disk performance using the fio utility"
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'

# Test Disk Performance

<Tabs queryString="benchmark-volumes">
  <TabItem value="linux">
    <TabItemLabel>
      Linux
    </TabItemLabel>

    For comprehensive performance testing of cloud server disks (read/write IOPS and bandwidth), use the `fio` utility. You can use test files—prepared text files containing testing settings—for testing.

    1. [Install the fio utility](#install-fio).

    2. [Prepare the disk for testing](#prepare-volume).

    3. [Test performance](#benchmark-in-linux).

    Test results can be compared to the [limits for network volumes](/cloud-servers/volumes/about-network-volumes.mdx#network-volume-limits) and [local disks](/cloud-servers/volumes/about-local-disks.mdx#local-disk-features).

    ## 1. Install the fio utility \{#install-fio}

    1. [Connect to the server](/cloud-servers/manage/connect-to-server.mdx).

    2. Install the `fio` utility:

       ```bash
       sudo apt update
       sudo apt install fio
       ```

    ## 2. Prepare the disk for testing \{#prepare-volume}

    :::danger

    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 exclude the influence of services and file system performance on the test result, we recommend [creating an empty network volume](/cloud-servers/volumes/create-volume.mdx) and filling it with data.

    1. [Create an empty disk](/cloud-servers/volumes/create-volume.mdx).

    2. [Attach the disk to the cloud server](/cloud-servers/volumes/attach-detach-volume.mdx#attach-network-volume-to-server).

    3. View the name of the empty disk:

       ```bash
       lsblk
       ```

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

    4. Fill the empty disk with data:

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

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

    ## 3. Test performance \{#benchmark-in-linux}

    You can use:

    * [IOPS testing](#test-iops-in-linux) — random write or read with 4 KB blocks; ;
    * [bandwidth testing](#test-bandwidth-in-linux) — random write or read with 4 MB blocks.

    ### Test IOPS \{#test-iops-in-linux}

    <Tabs queryString="test-iops-in-linux">
      <TabItem value="4-kb-write">
        <TabItemLabel>
          Write
        </TabItemLabel>

        1. Open the CLI.

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

           ```bash
           nano write.ini
           ```

        3. Add the following content to the test file:

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

           Where:

           * `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 write-to-disk using the `filename=/dev/sdb`;
           * `iodepth` — number of threads.

        4. Exit the `nano` text editor and save changes: press **Ctrl+X**, then **Y+Enter**.

        5. Run the test:

           ```bash
           fio write.ini
           ```

           Look for the IOPS value in the test output. Example output:

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

      <TabItem value="4-kb-read">
        <TabItemLabel>
          Read
        </TabItemLabel>

        1. Open the CLI.

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

           ```bash
           nano read.ini
           ```

        3. Add the following content to the test file:

           ```bash
           [readtest]
           size=2000M
           blocksize=4k
           filename=/dev/sdb
           rw=randread
           direct=1
           buffered=0
           ioengine=libaio
           iodepth=32
           ```

           Where:

           * `size` — total size of the file for testing;
           * `blocksize` — the 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 write-to-disk using the `filename=/dev/sdb`;
           * `iodepth` — number of threads.

        4. Exit the `nano` text editor and save changes: press **Ctrl+X**, then **Y+Enter**.

        5. Run the test:

           ```bash
           fio read.ini
           ```

           Look for the IOPS value in the test output. Example output:

           ```bash
           read: IOPS=320, BW=1280KiB/s (1311kB/s)(2000MiB/1599899msec)
           ```
      </TabItem>
    </Tabs>

    ### Test bandwidth \{#test-bandwidth-in-linux}

    <Tabs queryString="test-bandwidth-in-linux">
      <TabItem value="4-mb-write">
        <TabItemLabel>
          Write
        </TabItemLabel>

        1. Open the CLI.

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

           ```bash
           nano write.ini
           ```

        3. Add the following content to the file:

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

           Where:

           * `size` — total size of the test file; ;
           * `blocksize` — size of one block with which the read or write operation is performed;
           * `filename` — file to write or read. The examples below show tests with a write to disk with the `filename=/dev/sdb` parameter — the write will also destroy the data and file system on the disk if it exists;
           * `iodepth` — number of threads.

        4. Exit the `nano` text editor and save changes: press **Ctrl+X**, then **Y+Enter**.

        5. Run the test:

           ```bash
           fio write.ini
           ```

           Look for the bandwidth (BW) value in the test output. Example output:

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

      <TabItem value="4-mb-read">
        <TabItemLabel>
          Read
        </TabItemLabel>

        1. Open the CLI.

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

           ```bash
           nano read.ini
           ```

        3. Add the following content to the file:

           ```bash
           [readtest]
           size=2000M
           blocksize=4M
           filename=/dev/sdb
           rw=read
           direct=1
           buffered=0
           ioengine=libaio
           iodepth=32
           ```

           Where:

           * `size` — total size of the test file; ;
           * `blocksize` — size of one block with which the read or write operation is performed;
           * `filename` — file to write or read. The examples below show tests with a write to disk with the `filename=/dev/sdb` parameter — the write will also destroy the data and file system on the disk if it exists;
           * `iodepth` — number of threads.

        4. Exit the `nano` text editor and save changes: press **Ctrl+X**, then **Y+Enter**.

        5. Run the test:

           ```bash
           fio read.ini
           ```

           Look for the bandwidth (BW) value in the test output. Example output:

           ```bash
           read: IOPS=25, BW=100MiB/s (105MB/s)(2000MiB/19911msec)
           ```
      </TabItem>
    </Tabs>
  </TabItem>

  <TabItem value="windows">
    <TabItemLabel>
      Windows
    </TabItemLabel>

    For comprehensive performance testing of cloud server disks (read/write IOPS and bandwidth), use the CrystalDiskMark utility. We recommend testing on an additional cloud server disk.

    1. [Install the CrystalDiskMark utility](#install-crystaldiskmark).

    2. [Test performance](#benchmark-in-windows).

    Test results can be compared to the [limits for network volumes](/cloud-servers/volumes/about-network-volumes.mdx#network-volume-limits) and [local disks](/cloud-servers/volumes/about-local-disks.mdx#local-disk-features).

    ## 1. Install the CrystalDiskMark utility \{#install-crystaldiskmark}

    1. Download [CrystalDiskMark](https://crystalmark.info/en/download/).

    2. Run the installer.

    3. Follow the steps to install the utility.

    ## 2. Test performance \{#benchmark-in-windows}

    Before testing, terminate background application processes or reboot into safe mode. We recommend testing on an additional disk.

    You can use:

    * [IOPS testing](#test-iops-in-windows) — random write and read with 4 KB blocks;
    * [bandwidth testing](#test-bandwidth-in-windows) — random write and read with 4 MB blocks.

    ### Test IOPS \{#test-iops-in-windows}

    1. Run CrystalDiskMark.

    2. Go to **Profile**.

    3. Select **Demo**.

    4. Go to **Settings** → **Settings**.

    5. In the **Profile:Demo** block:

       5.1. In the **Type** column, select the testing type — RND. This testing type is responsible for random read and write.

       5.2. In the **Block Size** column, select the block size for testing — 4KiB.

       5.3. In the **Queues** column, select the request queue depth for testing — 32.

       5.4. In the **Threads** column, select the number of threads — 1.

    6. Click **OK**.

    7. In the units of measurement, select **IOPS**.

    8. Click **ALL**. The disk IOPS test will start.

    9. Look for the read and write IOPS values in the test output. Example output:

       ```bash
       Read 325 IOPS
       Write 121 IOPS
       ```

    ### Test bandwidth \{#test-bandwidth-in-windows}

    1. Run CrystalDiskMark.

    2. Go to **Profile**.

    3. Select **Demo**.

    4. Go to **Settings** → **Settings**.

    5. In the **Profile:Demo** block:

       5.1. In the **Type** column, select the testing type — SEQ. This testing type is responsible for sequential read and write.

       5.2. In the **Block Size** column, select the block size for testing — 4MiB.

       5.3. In the **Queues** column, select the request queue depth for testing — 32.

       5.4. In the **Threads** column, select the number of threads — 1.

    6. Click **OK**.

    7. In the units of measurement, select **MB/s**.

    8. Click **ALL**. The disk bandwidth test will start.

    9. Look for the read and write bandwidth values in the test output. Example output:

       ```bash
       Read 106.5 MB/s
       Write 95.6 MB/s
       ```
  </TabItem>
</Tabs>

<Formbricks />
