sudo yum install fio
sudo apt-get install fio
fio -directory=/path/to/cfs -iodepth=1 -time_based=1 -thread -direct=1 -ioengine=libaio -rw=randread -bs=4K -size=1M -numjobs=1 -runtime=60 -group_reporting -name=cfs_test
fio -directory=/path/to/cfs -iodepth=1 -time_based=1 -thread -direct=1 -ioengine=libaio -rw=randwrite -bs=4K -size=1M -numjobs=1 -runtime=60 -group_reporting -name=cfs_test
fio -directory=/path/to/cfs -iodepth=1 -time_based=1 -thread -direct=1 -ioengine=libaio -rw=randread -bs=4K -size=100M -numjobs=128 -runtime=60 -group_reporting -name=cfs_test
fio -directory=/path/to/cfs -iodepth=1 -time_based=1 -thread -direct=1 -ioengine=libaio -rw=randwrite -bs=4K -size=100M -numjobs=128 -runtime=60 -group_reporting -name=cfs_test
fio -directory=/path/to/cfs -iodepth=1 -time_based=1 -thread -direct=1 -ioengine=libaio -rw=randread -bs=1M -size=100M -numjobs=128 -runtime=60 -group_reporting -name=cfs_test
fio -directory=/path/to/cfs -iodepth=1 -time_based=1 -thread -direct=1 -ioengine=libaio -rw=randwrite -bs=1M -size=100M -numjobs=128 -runtime=60 -group_reporting -name=cfs_test
Parameter | Parameter Description |
direct | Indicates whether to use direct I/O. Default value is 1. Value of 1: Indicates to use direct I/O, and ignores the client's I/O cache, with data being written or read directly. Value of 0: Indicates not to use direct I/O. Note: This parameter cannot bypass server-side caching. |
iodepth | Indicates the I/O queue depth during testing. For example, -iodepth=1 means the maximum number of I/Os in an FIO control request is 1. |
rw | Indicates the read/write strategy during testing. You can set it to: randwrite: random write randread: random read read: sequential read write: sequential write randrw: mixed random read and write Note: Usually, during stress testing, random read/write are used. If sequential read/write performance metrics are required, parameters can be adjusted accordingly. |
ioengine | Indicates which I/O engine FIO should use during testing. Usually libaio is chosen to ensure asynchronous issuance of data IO. Note: If libaio is not chosen during stress testing, the performance bottleneck is mainly on the ioengine, not on the storage side. |
bs | Indicates the block size of the I/O unit. |
size | Indicates the testing file size. FIO will read/write the specified file size in its entirety before stopping the test. Unless it is limited by other options (such as runtime). If this parameter is not specified, FIO will use the full size of the given file or device. The size can also be given as a percentage between 1 and 100. For example, if size=20% is specified, FIO will use 20% of the full size of the given file or device. |
numjobs | Indicates the number of concurrent threads for the testing. |
runtime | Indicates the testing duration. It is the FIO execution duration. |
group_reporting | Indicates the testing results display mode. If this parameter is specified, the testing results will summarize the statistical information for each process, instead of for different tasks. |
directory | Indicates the file system mount point to be tested. Note: When this parameter is chosen, FIO will by default create files at this path, the number of which equals numjobs, for stress testing. This parameter is mandatory for storage stress testing, as specifying a filename directly targets a single file testing. |
name | Indicates the name of the testing task. It can be set according to actual needs. |
thread | Conduct stress testing using multi-threading rather than multi-processing. |
time_based | The value is set to 1: After the specified file size has been fully read and written, I/O operations are automatically repeated until the time specified by the runtime parameter expires. The value is set to 0: Testing stops immediately upon completion of reading and writing the specified file size. Note: Typically, the value is set to 1 during testing, which can ensure that the testing program runs continuously within the specified time period. |
Was this page helpful?