fio
Installing fio
You can install fio-3.7 using a Yum source. For example, run the following command to install fio-3.7 on CentOS 7.6.
1 | yum -y install fio |
You can also use the following method to download, compile, and install the source package.
- Download the fio package to the /home directory of each client.
- Decompress the fio package on each client.
1cd /home && tar -zxvf fio-3.7.tar.gz
- Go to the directory of the decompressed fio files.
1cd fio-3.7
- Install the RBD engine dependency.
- Compile and install fio.
1./configure && make && make install
fio Test Model
fio runs by executing a workload configuration file. You only need to execute the workload configuration file on any of the clients. The client automatically logs in to other clients based on the IP addresses of other clients specified in the workload configuration file to perform the test. Before the test, mount the CephFS file system.
Creating a fio Workload
This document uses one Ceph client as an example. Each client reads and writes 3 files, and the maximum read and write capacity is 10 GB for each file. The following describes how to create a 1 MB sequential write workload on client1. Create three configuration files for each client.
- Create the first configuration file.
1vi 1024Kclient1_file1_write.fio[global] ioengine=libaio size=10G direct=1 numjobs=1 runtime=60 ramp_time=10 log_avg_msec=500 thread time_based [1024K-write] filename=/mnt/cephfs/1024K_client1_file1 bs=1024K rw=write iodepth=64 write_bw_log=1024K-write stonewall buffer_compress_percentage=40
- Create the second configuration file.
1vi 1024Kclient1_file2_write.fio[global] ioengine=libaio size=10G direct=1 numjobs=1 runtime=60 ramp_time=10 log_avg_msec=500 thread time_based [1024K-read] filename=/mnt/cephfs/1024K_client1_file2 bs=1024K rw=read iodepth=64 write_bw_log=1024K-read stonewall buffer_compress_percentage=40
- Create the third configuration file.
1vi 1024Kclient1_file3_write.fio[global] ioengine=libaio size=10G direct=1 numjobs=1 runtime=60 ramp_time=10 log_avg_msec=500 thread time_based [1024K-rw] filename=/mnt/cephfs/1024K_client1_file3 bs=1024K rw=rw iodepth=64 write_bw_log=1024K-rw rwmixwrite=30 stonewall buffer_compress_percentage=40
buffer_compress_percentage=40 is used for testing compression. If this parameter is configured, the data written by fio is compressed at a certain ratio. If a compression test is not required, you can delete the parameter.
Performing a Test Case
- Start the fio service.
1fio -S &
- Execute the test case on client1 (image1write as an example).
1fio --client=client1 ./1024Kclient1_image1write.fio --client=client1 ./1024Kclient1_image2write.fio --client=client1 ./1024Kclient1_image3write.fio --output=./1mwrite.log
Viewing the Test Result
After the test is complete, the 1mwrite.log file in the current directory contains all test data.