fio性能测试-环境搭建,功能介绍,测试讲解

fio性能测试-环境搭建,功能介绍,测试讲解

Fio介绍:FIO(Flexible I/O Tester)是一个用于测试磁盘、文件系统、块设备和网络设备性能的工具。它可以模拟不同类型的I/O负载,包括随机或顺序读写、混合读写、随机或顺序访问等。FIO提供了丰富的选项和参数,可以对测试进行高度定制化配置,以满足各种应用场景和需求。FIO是开源软件,可在Linux、Unix、Windows等多种平台上运行。

1.测试环境

系统:CentOS Linux release 7.9.2009 (Core)

硬盘:7.7TB(RAID5 SAS 1.2TB*8)

2.fio工具下载

1) yum直接下载

yum install fio -y

查看版本:fio –v

 2) 下载fio解压包离线安装

下载地址:https://github.com/axboe/fio

百度微云:https://pan.baidu.com/s/1OX18q2yiB_ZE0CTL8k19kw 提取码:2023 

腾讯微云:https://share.weiyun.com/kU9ecAC7 密码:632jf8

libaio-devel是依赖包,如不安装fio无法使用,会报错:fio: engine libaio not loadable fio: failed to load engine

rpm –ivh libaio-*

unzip fio-3.6.zip                           #解压
ls
cd fio-3.6/fio-3.6                       #进入fio解压包
chmod +x *                           #打开权限
./configure                          #配置环境
make && make install                  #编译安装

查看是否安装成功:fio –v

3.功能介绍

4.性能测试

顺序读(rand):
fio --filename=/dev/sd? --ioengine=libaio --direct=1 --rw=read --bs=1M --numjobs=4 --iodepth=32 --runtime=300 --time_based  --thread --norandommap --group_reporting --name=fiotest
顺序写(write):
fio --filename=/dev/sd? --ioengine=libaio --direct=1 --rw=write --bs=1M --numjobs=4 --iodepth=32 --runtime=300 --time_based  --thread --norandommap --group_reporting --name=fiotest
随机读(randread):
fio --filename=/dev/sd? --ioengine=libaio --direct=1 --rw=randread --bs=4K --numjobs=4 --iodepth=32 --runtime=300 --time_based  --thread --norandommap --group_reporting --name=fiotest
随机写(randwrite):
fio --filename=/dev/sd? --ioengine=libaio --direct=1 --rw=randwrite --bs=4K --numjobs=4 --iodepth=32 --runtime=300 --time_based  --thread --norandommap --group_reporting --name=fiotest

结果分析:

测试结果:bw=1142Mib/s

也可以使用以下命令可直接查看结果(在参数末尾添加 | grep BW ):

fio --filename=/dev/sda --ioengine=libaio --direct=1 --rw=write --bs=1M --numjobs=4 --iodepth=32 --runtime=300 --time_based  --thread --norandommap --group_reporting --name=fiotest |grep BW

以下是输出结果:

测试结果有了怎么判断自己测试的数据是否合格呢?

根据你测试的硬盘型号,去硬盘官网查询硬盘的读写标准

 

 

 

 

 

 

 

 

 

编制fio性能测试图进行对比

我这里写了一个脚本,会自动生成测试日志,有需要的同学,可以关注我,我发给你。

 

 

#The write:zuijiaz@outlook.com
#Time of creation:2023.04.13

 

posted @ 2023-04-13 23:16  zuijiaz  阅读(571)  评论(3编辑  收藏  举报