---
title: "Test file storage performance"
sidebar_label: "Test file storage performance"
sidebar_position: 5
description: "How to test file storage 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'
import {CustomTable} from '@selectel/docux/components'

# Test file storage performance

:::info

This guide provides an example of testing file storage performance on a cloud server.

:::

To perform a comprehensive test of file storage performance (throughput values and read/write IOPS limits), use the `fio` utility.

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

2. [Test the performance](#benchmark).

Test results can be compared with the expected performance, which depends on the [file storage type](/file-storage/about/about-file-storage.mdx#file-storage-types). The values can be viewed in the [Limits and Restrictions table](/file-storage/about/about-file-storage.mdx#limits-and-restrictions).

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

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

2. Open the CLI.

3. Install the `fio` utility:

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

## 2. Test the performance \{#benchmark}

You can use:

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

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

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

    1. Open the CLI.

    2. Run the test:

       ```bash
       fio \
       --name=test1 \
       --blocksize=4k \
       --rw=randwrite \
       --direct=1 \
       --buffered=0 \
       --ioengine=libaio \
       --iodepth=16 \
       --loops=1000 \
       --runtime=30 \
       --filename=/mnt/nfs/test \
       --size=99G
       ```

       Specify:

       * `blocksize` — the size of a single block for the read or write operation;
       * `iodepth` — the number of threads;
       * `filename` — the file for writing or reading. The examples below show tests using the `filename=/mnt/nfs/test` parameter — a separate file will be created for the test in the directory where the file storage is mounted;
       * `size` — the total size of the test file. For relevant results, we recommend testing on file storage larger than 100 GB.

    3. In the test output, check the write IOPS limit value (`IOPS`):

       ```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. Run the test:

       ```bash
       fio \
       --name=test1 \
       --blocksize=4k \
       --rw=randread \
       --direct=1 \
       --buffered=0 \
       --ioengine=libaio \
       --iodepth=16 \
       --loops=1000 \
       --runtime=30 \
       --filename=/mnt/nfs/test \
       --size=99G
       ```

       Specify:

       * `blocksize` — the size of a single block for the read or write operation;
       * `iodepth` — the number of threads;
       * `filename` — the file for writing or reading. The examples below show tests using the `filename=/mnt/nfs/test` parameter — a separate file will be created for the test in the directory where the file storage is mounted;\</;
       * `size` — the total size of the test file. For relevant results, we recommend testing on file storage larger than 100 GB.

    3. In the test output, check the read IOPS limit value (`IOPS`):

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

### Test throughput \{#test-bandwidth}

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

    1. Open the CLI.

    2. Run the test:

       ```bash
       fio \
       --name=test1 \
       --blocksize=4M \
       --rw=write \
       --direct=1 \
       --buffered=0 \
       --ioengine=libaio \
       --iodepth=16 \
       --loops=1000 \
       --runtime=30 \
       --filename=/mnt/nfs/test \
       --size=99G
       ```

       Specify:

       * `blocksize` — the size of a single block for the read or write operation;
       * `iodepth` — the number of threads;
       * `filename` — the file for writing or reading. The examples below show tests using the `filename=/mnt/nfs/test` parameter — a separate file will be created for the test in the directory where the file storage is mounted;
       * `size` — the total size of the test file. For relevant results, we recommend testing on file storage larger than 100 GB.

    3. In the test output, check the throughput value (`BW`):

       ```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. Run the test:

       ```bash
       fio \
       --name=test1 \
       --blocksize=4M \
       --rw=read \
       --direct=1 \
       --buffered=0 \
       --ioengine=libaio \
       --iodepth=16 \
       --loops=1000 \
       --runtime=30 \
       --filename=/mnt/nfs/test \
       --size=99G
       ```

       Specify:

       * `blocksize` — the size of a single block for the read or write operation;
       * `iodepth` — the number of threads;
       * `filename` — the file for writing or reading. The examples below show tests using the `filename=/mnt/nfs/test` parameter — a separate file will be created for the test in the directory where the file storage is mounted;
       * `size` — the total size of the test file. For relevant results, we recommend testing on file storage larger than 100 GB.

    3. In the test output, check the throughput value (`BW`):

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

<Formbricks />
