# wget http://brick.kernel.dk/snaps/fio-2.2.5.tar.gz
# tar xvf fio-2.2.5.tar.gz
# cd fio-2.2.5
# ./configure
# make && make install
FIO的用法:
FIO分顺序读,随机读,顺序写,随机写,混合随机读写模式。
这是一个顺序读的模式:
fio -filename=/dev/sda -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=16k -size=5G -numjobs=30 -runtime=1000 -group_reporting -name=mytest
说明:
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引擎使用pync方式
rwmixwrite=30                             在混合读写的模式下,写占30%
group_reporting                            关于显示结果的,汇总每个进程的信息。
lockmem=1G                                 只使用1g内存进行测试。
zero_buffers                                  用0初始化系统buffer。
nrfiles=8                                       每个进程生成文件的数量。
所以,随机读:
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=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=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
上面的测试是磁盘还没有分区格式化
实际测试范例,针对已分区格式化形式
测试混合随机读写:
# fio -filename=/app/mysqldata1 -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=16k -size=10G -numjobs=30 -runtime=100 -group_reporting -name=mytest1
roup_reporting -name=mytest1
mytest1: (g=0): rw=randrw, bs=16K-16K/16K-16K/16K-16K, ioengine=psync, iodepth=1
...
fio-2.2.5
Starting 30 threads
Jobs: 1 (f=1): [_(29),m(1)] [4.6% done] [60579KB/26277KB/0KB /s] [3786/1642/0 iops] [eta 35m:10s]
mytest1: (groupid=0, jobs=30): err= 0: pid=17802: Tue Mar 12 15:46:49 2019
  read : io=9635.3MB, bw=98656KB/s, iops=6165, runt=100009msec
    clat (usec): min=242, max=234613, avg=3549.81, stdev=4541.78
     lat (usec): min=242, max=234613, avg=3550.11, stdev=4541.84
    clat percentiles (usec):
     |  1.00th=[ 1048],  5.00th=[ 1336], 10.00th=[ 1512], 20.00th=[ 1784],
     | 30.00th=[ 2064], 40.00th=[ 2416], 50.00th=[ 2832], 60.00th=[ 3280],
     | 70.00th=[ 3760], 80.00th=[ 4384], 90.00th=[ 5600], 95.00th=[ 7328],
     | 99.00th=[18816], 99.50th=[20608], 99.90th=[38144], 99.95th=[104960],
     | 99.99th=[211968]
    bw (KB  /s): min=  510, max= 4448, per=3.34%, avg=3292.70, stdev=493.14
  write: io=4144.6MB, bw=42437KB/s, iops=2652, runt=100009msec
    clat (usec): min=142, max=55798, avg=3045.06, stdev=1843.06
     lat (usec): min=142, max=55799, avg=3046.51, stdev=1844.03
    clat percentiles (usec):
     |  1.00th=[  290],  5.00th=[ 1012], 10.00th=[ 1368], 20.00th=[ 1720],
     | 30.00th=[ 1992], 40.00th=[ 2288], 50.00th=[ 2704], 60.00th=[ 3120],
     | 70.00th=[ 3600], 80.00th=[ 4192], 90.00th=[ 5088], 95.00th=[ 5984],
     | 99.00th=[ 8384], 99.50th=[10432], 99.90th=[19328], 99.95th=[21888],
     | 99.99th=[35584]
    bw (KB  /s): min=  128, max= 2226, per=3.34%, avg=1415.95, stdev=261.99
    lat (usec) : 250=0.21%, 500=0.41%, 750=0.44%, 1000=0.94%
    lat (msec) : 2=26.65%, 4=46.33%, 10=23.32%, 20=1.23%, 50=0.42%
    lat (msec) : 100=0.01%, 250=0.05%
  cpu          : usr=0.09%, sys=2.90%, ctx=880888, majf=0, minf=7
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued    : total=r=616655/w=265252/d=0, short=r=0/w=0/d=0, drop=r=0/w=0/d=0
     latency   : target=0, window=0, percentile=100.00%, depth=1
Run status group 0 (all jobs):
   READ: io=9635.3MB, aggrb=98655KB/s, minb=98655KB/s, maxb=98655KB/s, mint=100009msec, maxt=100009msec
  WRITE: io=4144.6MB, aggrb=42436KB/s, minb=42436KB/s, maxb=42436KB/s, mint=100009msec, maxt=100009msec
Disk stats (read/write):
    dm-0: ios=616673/265257, merge=0/0, ticks=584135/79775, in_queue=663909, util=99.98%, aggrios=616677/265258, aggrmerge=0/0, aggrticks=583355/79389, aggrin_queue=662276, aggrutil=99.96%
  sda: ios=616677/265258, merge=0/0, ticks=583355/79389, in_queue=662276, util=99.96%
 
 
# fio --help
fio-2.1.10
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
  --parse-only  Parse options only, don't start any IO
  --output  Write output to file
  --runtime  Runtime in seconds
  --latency-log  Generate per-job latency logs
  --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
  --idle-prof=option Report cpu idleness on a system or percpu basis
   (option=system,percpu) or run unit work
   calibration only (option=calibrate)
Fio was written by Jens Axboe <jens.axboe@oracle.com>
                   Jens Axboe <jaxboe@fusionio.com>
                   Jens Axboe <axboe@fb.com>

fio安装使用的更多相关文章

  1. fio 2种画图方法 fio_generate_plots 和 gfio

    fio 安装fio apt-get install fio 可以把fio的输出数据自动画图的插件gnuplot apt-get install gnuplot 1.输出bw,lat和iops数据并画图 ...

  2. FIO 测试磁盘iops 以及读写

    最近在做mariadb的性能,感觉io 有瓶颈,就使用fio 来测试一下磁盘.下文为转载文章(温馨提示:此命令很伤硬盘,测试前请备份数据,- -我就写坏了一个.) FIO 是测试IOPS的非常好的工具 ...

  3. linux使用FIO测试磁盘的iops 【转载】

     linux使用FIO测试磁盘的iops 2013-09-23 10:59:21 分类: LINUX FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎,包括 ...

  4. linux使用FIO测试磁盘的iops

    FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎,包括:sync,mmap, libaio, posixaio, SG v3, splice, null, ...

  5. 使用FIO测试磁盘iops

    我们如何衡量一个存储的性能呢?IOPS(Input/Output OperationsPer Second),即每秒进行读写(I/O)操作的次数是国际上通用的存储性能衡量标准,IOPS越高意味着在同一 ...

  6. FIO测试磁盘的iops

    FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎,包括:sync,mmap, libaio, posixaio, SG v3, splice, null, ...

  7. linux 使用FIO测试磁盘iops 方法详解

    FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎, 包括:sync,mmap, libaio, posixaio, SG v3, splice, null, ...

  8. 云计算&存储测试:FIO工具入门与实战

    一.关于FIO 1.1 简介 FIO是一个开源的I/O压力测试工具,主要是用来测试磁盘的IO性能,也可测试cpu,nic的IO性能.它可以支持13种不同的I/O引擎,包括:sync,mmap, lib ...

  9. linux 使用 FIO 测试磁盘的iops

    原文链接:https://www.iteye.com/blog/elf8848-2168876 一,FIO安装wget http://brick.kernel.dk/snaps/fio-2.2.5.t ...

随机推荐

  1. 【java设计模式】-06原型模式

    原型模式简述 定义: 使用原型实例指定待创建对象的类型,并且通过复制这个原型来创建新的对象 ,也就是通过复制现有对象实例产生新的对象,也就是所谓的"克隆" 实现方式: 1.实现Cl ...

  2. 执行jar包或执行其中的某个类

    执行jar包,默认执行javafile中指定的main程序java -jar jar包例如 java -jar test.jar执行依赖其他jar包的class: java -cp .;E:\tool ...

  3. LeetCode 229. 求众数 II(Majority Element II )

    题目描述 给定一个大小为 n 的数组,找出其中所有出现超过 ⌊ n/3 ⌋ 次的元素. 说明: 要求算法的时间复杂度为 O(n),空间复杂度为 O(1). 示例 1: 输入: [3,2,3] 输出: ...

  4. centos 如何查看命令是由哪个包提供的

    yum whatprovides */ifconfig Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile ...

  5. Rocketmq同步发送消息

    package com.bfxy.rocketmq.quickstart; import org.apache.rocketmq.client.exception.MQBrokerException; ...

  6. P2602 [ZJOI2010]数字计数&P1239 计数器&P4999 烦人的数学作业

    P2602 [ZJOI2010]数字计数 题解 DFS 恶心的数位DP 对于这道题,我们可以一个数字一个数字的求 也就是分别统计区间 [ L , R ] 内部数字 i 出现的次数 (0<=i&l ...

  7. 自定义 TreeView 第三种状态(C#自定义控件)

    本文核心部分采用 http://blog.csdn.net/am2004/article/details/1621349 此网站代码. 在增加了部份事件的同时,将点击图片更改节点选中状态 这一小地方作 ...

  8. mha之vip漂移 配置binlog-server备份服务器 Atlas

    MHAvip漂移 配置 通过MHA自带脚本方式,管理虚拟IP的漂移 获取管理脚本master_ip_failover cp master_ip_failover /usr/local/bin/ #脚本 ...

  9. js实现动态显示时间

    思路: *得到当前时间 var date = new Date(); //格式化为本地时间 var d1 = date.toLocaleString(); *使页面每秒显示一次时间 setInterv ...

  10. 语法错误 : 缺少“;”(在“<”的前面)

    该错误有可能是由错误所指行“<”附近的某个类型忘记#include <>所造成的