Performance testing
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
Connect to the ECS instance. For more information, see Connection methods for ECS instances.
Install the FIO tool. If FIO is already installed, you can skip this step.
Operating system
Installation command
CentOS
sudo yum install fioRedhat
Alibaba Cloud Linux
Ubuntu
Run the following installation commands in order:
sudo apt-get updatesudo apt-get install fio
Debian
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_TestingRandom 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_TestingSequential 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_TestingSequential 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_TestingRandom 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_TestingRandom 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.
|
iodepth | Specifies the I/O queue depth for the test. For example, |
rw | Specifies the read/write policy for the test. You can set this parameter to one of the following values:
|
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 |
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.