备注:
使用的是yum 进行的安装,大家可以使用源码编译安装(centos 7)

安装

yum install -y fio

命令行参数

fio-2.2.8
fio [options] [job options] <job file(s)>
--debug=options Enable debug logging. May be one/more of:
process,file,io,mem,blktrace,verify,random,parse,
diskutil,job,mutex,profile,time,net,rate,compress
--parse-only Parse options only, don't start any IO
--output Write output to file
--runtime Runtime in seconds
--bandwidth-log Generate per-job bandwidth logs
--minimal Minimal (terse) output
--output-format=x Output format (terse,json,normal)
--terse-version=x Set terse version output format to 'x'
--version Print version info and exit
--help Print this page
--cpuclock-test Perform test/validation of CPU clock
--crctest Test speed of checksum functions
--cmdhelp=cmd Print command help, "all" for all of them
--enghelp=engine Print ioengine help, or list available ioengines
--enghelp=engine,cmd Print help for an ioengine cmd
--showcmd Turn a job file into command line options
--eta=when When ETA estimate should be printed
May be "always", "never" or "auto"
--eta-newline=time Force a new line for every 'time' period passed
--status-interval=t Force full status dump every 't' period passed
--readonly Turn on safety read-only checks, preventing writes
--section=name Only run specified section in job file
--alloc-size=kb Set smalloc pool to this size in kb (def 1024)
--warnings-fatal Fio parser warnings are fatal
--max-jobs=nr Maximum number of threads/processes to support
--server=args Start a backend fio server
--daemonize=pidfile Background fio server, write pid to file
--client=hostname Talk to remote backend fio server at hostname
--remote-config=file Tell fio server to load this local job file
--idle-prof=option Report cpu idleness on a system or percpu basis
(option=system,percpu) or run unit work
calibration only (option=calibrate)
--trigger-file=file Execute trigger cmd when file exists
--trigger-timeout=t Execute trigger af this time
--trigger=cmd Set this command as local trigger
--trigger-remote=cmd Set this command as remote trigger

使用

filename: 指定文件(设备)的名称。可以通过冒号分割同时指定多个文件,如filename=/dev/sda:/dev/sdb。
directory: 设置filename的路径前缀。在后面的基准测试中,采用这种方式来指定设备。
name: 指定job的名字,在命令行中表示新启动一个job。
direct: bool类型,如果设置成true (1),表示不使用io buffer。
ioengine: I/O引擎,现在fio支持19种ioengine。默认值是sync同步阻塞I/O,libaio是Linux的native异步I/O。关于同步异步,阻塞和非阻塞模型可以参考文章“使用异步 I/O 大大提高应用程序的性能”。
http://www.ibm.com/developerworks/cn/linux/l-async/
iodepth: 如果ioengine采用异步方式,该参数表示一批提交保持的io单元数。该参数可参考文章“Fio压测工具和io队列深度理解和误区”。
http://blog.yufeng.info/archives/2104
rw: I/O模式,随机读写,顺序读写等等。
bs: I/O block大小,默认是4k。
size: 指定job处理的文件的大小。
numjobs: 指定job的克隆数(线程)。
time_based: 如果在runtime指定的时间还没到时文件就被读写完成,将继续重复知道runtime时间结束。
runtime: 指定在多少秒后停止进程。如果未指定该参数,fio将执行至指定的文件读写完全完成。
group_reporting: 当同时指定了numjobs了时,输出结果按组显示。

参考说明

filename=/dev/sdb1 #测试文件名称,通常选择需要测试的盘的data目录
direct=1 #测试过程绕过机器自带的buffer。使测试结果更真实
rw=randwrite #测试随机写的I/O
rw=randrw #测试随机写和读的I/O
bs=16k #单次io的块文件大小为16k
bsrange=512-2048 #同上,提定数据块的大小范围
size=5G #本次的测试文件大小为5g,以每次4k的io进行测试
numjobs=30 #本次的测试线程为30个
runtime=1000 #测试时间1000秒,如果不写则一直将5g文件分4k每次写完为止
ioengine=psync #io引擎使用psync方式
rwmixwrite=30 #在混合读写的模式下,写占30%
group_reporting #关于显示结果的,汇总每个进程的信息
lockmem=1G #只使用1g内存进行测试
zero_buffers #用0初始化系统buffer
nrfiles=8 #每个进程生成文件的数量
#顺序读
fio -filename=/dev/sda -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=16k -size=200G -numjobs=30 -runtime=1000 -group_reporting -name=mytest
#顺序写
fio -filename=/dev/sda -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=16k -size=200G -numjobs=30 -runtime=1000 -group_reporting -name=mytest
#随机读
fio -filename=/dev/sda -direct=1 -iodepth 1 -thread -rw=randread -ioengine=psync -bs=16k -size=200G -numjobs=30 -runtime=1000 -group_reporting -name=mytest
#随机写
fio -filename=/dev/sda -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=16k -size=200G -numjobs=30 -runtime=1000 -group_reporting -name=mytest
#混合随机读写
fio -filename=/dev/sda -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=16k -size=200G -numjobs=30 -runtime=100 -group_reporting -name=mytest -ioscheduler=noop
#复制下面的配置内容,将directory=/path/to/test修改为你测试硬盘挂载目录的地址,并另存为fio.conf
[global]
ioengine=libaio
direct=1
thread=1
norandommap=1
randrepeat=0
runtime=60
ramp_time=6
size=1g
directory=/path/to/test
[read4k-rand]
stonewall
group_reporting
bs=4k
rw=randread
numjobs=8
iodepth=32
[read64k-seq]
stonewall
group_reporting
bs=64k
rw=read
numjobs=4
iodepth=8
[write4k-rand]
stonewall
group_reporting
bs=4k
rw=randwrite
numjobs=2
iodepth=4
[write64k-seq]
stonewall
group_reporting
bs=64k
rw=write
numjobs=2
iodepth=4
#测试
fio fio.conf

参考资料

https://fio.readthedocs.io/en/latest/fio_doc.html

 
 
 
 

fio 文件系统io 性能测试安装使用的更多相关文章

  1. 如何用sysbench做好IO性能测试

    sysbench 是一个非常经典的综合性能测试工具,通常都用它来做数据库的性能压测,但也可以用来做CPU,IO的性能测试.而对于IO测试,不是很推荐sysbench,倒不是说它有错误,工具本身没有任何 ...

  2. github.io hexo 安装

    /***************************************************************** * github.io hexo 安装 * 说明: * 本文记录h ...

  3. 轻量级分布式文件系统FastDFS使用安装说明手册(新手入门级)

    轻量级分布式文件系统FastDFS使用安装说明手册(新手入门级) 实验室所在的课题组以研究云计算为主,但所有的研究都是在基于理论的凭空想像,缺少分布式环境的平台的实践,云计算神马的都是浮云了.因此,我 ...

  4. Oracle IO性能测试

    Oracle IO性能测试 前言 最近发生了迁移测试库后(单节点迁移RAC)因为IO性能问题导致迁移后性能非常差的问题. 原本想在创建ASM磁盘组之前用Orion做测试,但是忘了做就没做结果出了这档子 ...

  5. Fio IO性能测试

    fio-2.1.2-1.el5.rf.x86_64 介绍 fio different types of I/O engines (sync, mmap, libaio, posixaio, SG v3 ...

  6. (转)Linux 磁盘IO性能测试

    Linux 如何测试 IO 性能(磁盘读写速度) 这几天做MySQL性能测试,偌大一个公司,找几台性能测试机器都很纠结,终于协调到两台,IO的性能如何还不知道.数据库属于IO密集型的应用,所以还是先评 ...

  7. Linux 文件系统IO性能优化【转】

    转自:https://blog.csdn.net/doitsjz/article/details/50837569 对于LINUX SA来说,服务器性能是需要我们特别关注的,包括CPU.IO.内存等等 ...

  8. Imply.io单机安装

    安装 wget https://static.imply.io/release/imply-2.5.15.tar.gz .tar.gz -C /usr/local/ cd imply- nohup b ...

  9. Linux 文件系统IO性能优化

    对于LINUX SA来说,服务器性能是需要我们特别关注的,包括CPU.IO.内存等等系统的优化变得至关重要,这里转载一篇非常不错的关于IO优化的文章,供大家参考和学习: 一.关于页面缓存的信息,可以用 ...

随机推荐

  1. python内存机制与垃圾回收、调优手段

    目录 一.python的内存机制 二.python的垃圾回收 1. 引用计数 1.1 原理: 1.2 优缺点: 1.4 两种情况: 2. 标记清除 2.1 原理: 2.2 优缺点: 3. 分代回收 3 ...

  2. MOOC python笔记(一):python语言概述

    python语言简介 特点:简单.易学.使用者多. 荷兰人Guido 1989年发明. 面向对象的解释型计算机程序设计语言. 设计哲学是"优雅"."明确".&q ...

  3. 反射之关于MethodInfo的使用

    1.MethodInfo类是在System.Reflection命名空间底下,既然是在Reflection空间底下.故名思议关于反射相关的操作,其中比较重要的方法是Invoke()方法,它是加载相同程 ...

  4. 启动OpenOffice服务

    下载安装 安装OpenOffice 4.1.6:下载路径:http://www.openoffice.org/zh-cn/download/ 启动 用以下命令启动OpenOffice服务,注意ip,如 ...

  5. 使用原生JS 修改 DIV 属性

    本例参考并改进自:https://www.jianshu.com/p/2961d9c317a3 大家可以一起学习!! <!DOCTYPE html> <html lang=" ...

  6. ABAP-表修改日志存储

    1.设置了变更文档的,可以通过查看标准表CDHDR,CDPOS SE38   --  RSUSR200   ST03N -- 专家模式 2.SE16N维护的数据,可以查看表SE16N_CD_KEY,S ...

  7. 个人项目(JAVA实现)

    一:Github项目地址:https://github.com/candy07213/WC 二:PSP表格 PSP2.1 Personal Software Process Stages 预估耗时(分 ...

  8. 阿里云搭建git服务器

    阿里云服务器环境: CentOS7.0 jdk1.8.0 jre1.8.0 RAM:1G SWAP:3G MEM:40G apache-tomcat 8.0 1.下载gitlab-ce 11.0 到本 ...

  9. openresty应用场景以及研发网关系统功能说明

    openresty主要应用场景 Web应用 进行一些业务逻辑处理,甚至进行耗CPU的模板渲染,一般流程:mysql/redis/http获取数据.业务处理.产生JSON/XML/模板渲染内容,比如京东 ...

  10. 【等待事件】等待事件系列(5.1)--Enqueue(队列等待)

    [等待事件]等待事件系列(5.1)--Enqueue(队列等待)   1  BLOG文档结构图   2  前言部分   2.1  导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可 ...