This topic describes how to use the fio tool to test the performance of a Cloud Parallel File Storage (CPFS) file system, including the throughput and input/output operations per second (IOPS).
Prerequisites
A test CPFS file system is created and mounted on an Elastic Compute Service (ECS) instance.
The test ECS instance has sufficient CPU cores and internal bandwidth. The number of CPU cores must be greater than or equal to 8.
Background information
The performance testing results vary with test tools and cannot reflect the actual performance. We recommend that you use fio to test the performance of a CPFS file system. The performance results in this topic are obtained from a test that is performed on a Linux ECS instance by using fio. These results are used as performance references for CPFS file systems.
Procedure
Connect to the ECS instance. For more information, see Connection method overview.
Install the fio tool. If the fio tool is installed, skip this step and run the performance test commands.
Operating system
Installation command
CentOS
sudo yum install fioRed Hat Enterprise Linux (RHEL)
Alibaba Cloud Linux
Ubuntu
Run the following commands in sequence:
sudo apt-get updatesudo apt-get install fio
Debian
Run the performance test commands.
Command used to test the 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_TestingCommand used to test the 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_TestingCommand used to test the 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_TestingCommand used to test the 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_TestingCommand used to test the 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_TestingCommand used to test the 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 description
The following table describes the parameters in the preceding fio commands.
Parameter | Description |
direct | Specifies whether to use direct I/O. Default value: 1. Valid values:
|
iodepth | The I/O queue depth during the test. For example, |
rw | The read/write policy that is used during the test. Valid values:
|
ioengine | The I/O engine that fio uses for the test. In most cases, libaio is used. For information about other available I/O engines, see the fio documentation. |
bs | The block size of I/O units. Default value: 4k, which indicates 4 KiB. Values for reads and writes can be specified in the <Value for reads>,<value for writes> format. If you do not specify a value, the default value is used. |
size | The size of the test files. fio ends the test only after the specified size of the files is read or written, unless limited by specific factors, such as runtime. If this parameter is not specified, fio uses the size of all given files or devices. The valid values can also be a percent that ranges from 1% to 100%. For example, if the size parameter is set to 20%, fio uses 20% of the size of all given files or devices. |
numjobs | The number of concurrent threads that are used during the test. The value is 256 in this example. |
runtime | The duration of the test, which indicates the period of time for which fio runs. If this parameter is not specified, the test does not end until the files whose size is specified by the size parameter are read or written in the block size specified by the bs parameter. |
group_reporting | The display mode of the test results. If this parameter is specified, per-process statistics instead of per-task statistics are displayed. |
directory | The mount path of the file system to be tested. The value is |
name | The name of the test. You can specify the parameter based on your needs. For example, Rand_Write_Testing. |
For more information about the parameters, see fio(1) - Linux man page.