Performance testing

更新时间:
复制 MD 格式

This topic describes how to use the Flexible I/O Tester (FIO) tool on Linux to test the throughput and input/output operations per second (IOPS) of a Cloud Parallel File Storage (CPFS) file system.

Prerequisites

  • You have created a CPFS file system and mounted it to an ECS instance.

  • The ECS instance used for the test has sufficient CPU resources (8 cores or more) and internal bandwidth.

Background information

You can use the FIO tool to test the performance of your CPFS file system. Performance test results can vary between different tools and may not reflect the actual performance. The performance metrics in this topic are from tests run with the FIO tool on Linux. These metrics serve as a performance reference for the Cloud Parallel File Storage product.

Procedure

  1. Connect to the ECS instance. For more information, see Connection methods for ECS instances.

  2. Install the FIO tool. If FIO is already installed, you can skip this step.

    Operating system

    Installation command

    CentOS

    sudo yum install fio

    Redhat

    Alibaba Cloud Linux

    Ubuntu

    Run the following installation commands in order:

    1. sudo apt-get  update
    2. sudo apt-get install fio

    Debian

  3. Run the performance test commands.

    • Random write IOPS:

      fio -direct=1 -ioengine=libaio -iodepth=1 -rw=randwrite -bs=4k -size=1G -numjobs=256 -runtime=600 -time_based=1 -group_reporting -directory="/mnt/cpfs/test" -name=Rand_Write_Testing
    • Random read IOPS:

      fio -direct=1 -ioengine=libaio -iodepth=1 -rw=randread -bs=4k -size=1G -numjobs=256 -runtime=600 -time_based=1 -group_reporting -directory="/mnt/cpfs/test" -name=Rand_Read_Testing
    • Sequential write throughput:

      fio -direct=1 -ioengine=libaio -iodepth=1 -rw=write -bs=1m -size=1G -numjobs=256 -runtime=600 -time_based=1 -group_reporting -directory="/mnt/cpfs/test" -name=Seq_Write_Testing
    • Sequential read throughput:

      fio -direct=1 -ioengine=libaio -iodepth=1 -rw=read -bs=1m -size=1G -numjobs=256 -runtime=600 -time_based=1 -group_reporting -directory="/mnt/cpfs/test" -name=Seq_Read_Testing
    • Random write throughput:

      fio -direct=1 -ioengine=libaio -iodepth=1 -rw=randwrite -bs=1m -size=1G -numjobs=256 -runtime=600 -time_based=1 -group_reporting -directory="/mnt/cpfs/test" -name=Rand_Write_Testing
    • Random read throughput:

      fio -direct=1 -ioengine=libaio -iodepth=1 -rw=randread -bs=1m -size=1G -numjobs=256 -runtime=600 -time_based=1 -group_reporting -directory="/mnt/cpfs/test" -name=Rand_Read_Testing

FIO parameter descriptions

The following table describes the FIO parameters used in the test commands.

Parameter

Description

direct

Specifies whether to use direct I/O. Default value: 1.

  • A value of 1 specifies to use direct I/O, which bypasses the I/O cache and writes data directly to the storage.

  • A value of 0 specifies not to use direct I/O.

iodepth

Specifies the I/O queue depth for the test. For example, -iodepth=1 indicates that the maximum number of I/O requests that FIO can have in flight is 1.

rw

Specifies the read/write policy for the test. You can set this parameter to one of the following values:

  • randwrite: random write.

  • randread: random read.

  • read: sequential read.

  • write: sequential write.

  • randrw: mixed random read and write.

ioengine

Specifies the I/O engine for FIO to use during the test. The libaio engine is typically used because it aligns with common application patterns. For more options, see the official FIO documentation.

bs

Specifies the block size for each I/O unit. Default value: 4 KiB. You can specify separate values for read and write operations in the read,write format. You can leave either value empty to use the default.

size

Specifies the size of the test file.

FIO reads or writes the entire specified file size before the test stops, unless limited by other options such as runtime. If you do not specify this parameter, FIO uses the full size of the given file or device. You can also specify the size as a percentage from 1 to 100. For example, if you specify size=20%, FIO uses 20% of the full size of the given file or device.

numjobs

Specifies the number of concurrent threads for the test. In this example, the value is 256.

runtime

Specifies the test duration, which is the runtime for FIO.

If this parameter is not specified, FIO continuously reads or writes the entire file specified by the size parameter, using the value of the bs parameter as the block size.

group_reporting

Specifies the display mode for the test results.

If you specify this parameter, the test results aggregate the statistics for each process instead of reporting statistics for each task separately.

directory

Specifies the mount path of the file system to be tested. In this example, the path is /mnt/cpfs/test. Replace it with your actual path.

name

Specifies the name of the test task. You can set this to any name. For example, Rand_Write_Testing is used in this topic.

For more information about these parameters, see the FIO man page.

Related topics