简介

fio是IO工具,既可以用于基准测试,也可以用于硬件的压力测试验证(stress/hardware verification)。

支持13种不同的IO引擎(sync、mmap、libaio、posixaio、SG v3、splice、null、network、syslet、guasi、solarisaio或者更多),IO优先级(支持更新的Linux内核),rate IO,forked or 线程任务等。既适用于块设备,也适用于文件。fio可以解析job描述,这些描述来自于简单可理解的文本格式文件。

fio可以展示多种io性能信息,包括IO延迟(IO latencies),IO百分率(IO percentiles)。FIO有广泛的应用,例如基准测试、质量测试(QA)、测试验证等。支持Linux、FreeBSD、NetBSD、OS X、Open Solaris、AIX、HPUX以及Windows等操作系统。

fio is an I/O tool meant to be used both for benchmark and stress/hardware verification. It has support for 13 different types of I/O engines (sync, mmap, libaio, posixaio, SG v3, splice, null, network, syslet, guasi, solarisaio, and more), I/O priorities (for newer Linux kernels), rate I/O, forked or threaded jobs, and much more. It can work on block devices as well as files. fio accepts job descriptions in a simple-to-understand text format. Several example job files are included. fio displays all sorts of I/O performance information, including complete IO latencies and percentiles. Fio is in wide use in many places, for both benchmarking, QA, and verification purposes. It supports Linux, FreeBSD, NetBSD, OS X, OpenSolaris, AIX, HP-UX, and Windows.

http://freecode.com/projects/fio

特点

这个工具最大的特点是使用简单,支持的文件操作非常多, 可以覆盖到我们能见到的文件使用方式:
sync:Basic read(2) or write(2) I/O. fseek(2) is used to position the I/O location.
psync:Basic pread(2) or pwrite(2) I/O.
vsync: Basic readv(2) or writev(2) I/O. Will emulate queuing by coalescing adjacents IOs into a single submission.
libaio: Linux native asynchronous I/O.
posixaio: glibc POSIX asynchronous I/O using aio_read(3) and aio_write(3).
mmap: File is memory mapped with mmap(2) and data copied using memcpy(3).
splice: splice(2) is used to transfer the data and vmsplice(2) to transfer data from user-space to the kernel.
syslet-rw: Use the syslet system calls to make regular read/write asynchronous.
sg:SCSI generic sg v3 I/O.
net : Transfer over the network. filename must be set appropriately to `host/port’ regardless of data direction. If receiving,
only the port argument is used.
netsplice: Like net, but uses splice(2) and vmsplice(2) to map data and send/receive.
guasi The GUASI I/O engine is the Generic Userspace Asynchronous Syscall Interface approach to asycnronous I/O.

还可以控制io depth对于测试磁盘的性能很有帮助,对结果的解读也做的很明白。

http://blog.yufeng.info/archives/677

帮助

fio-2.1.2
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
--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
--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)

例子

[root@localhost data1]# fio --filename=/dev/sda6 --direct=1 --rw=randread --bs=4k --size=60G --numjobs=64 --runtime=10 --group_reporting --name=file2
file2: (g=0): rw=randread, bs=4K-4K/4K-4K/4K-4K, ioengine=sync, iodepth=1
...
file2: (g=0): rw=randread, bs=4K-4K/4K-4K/4K-4K, ioengine=sync, iodepth=1
fio-2.1.2
Starting 64 processes
Jobs: 64 (f=64): [rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr] [100.0% done] [33816KB/0KB/0KB /s] [8454/0/0 iops] [eta 00m:00s]
file2: (groupid=0, jobs=64): err= 0: pid=5176: Mon Nov 11 11:19:07 2013
read : io=332596KB, bw=33134KB/s, iops=8283, runt= 10038msec
clat (usec): min=61, max=214260, avg=7689.06, stdev=10823.87
lat (usec): min=61, max=214260, avg=7689.46, stdev=10823.87
clat percentiles (usec):
| 1.00th=[ 229], 5.00th=[ 247], 10.00th=[ 262], 20.00th=[ 334],
| 30.00th=[ 1672], 40.00th=[ 2928], 50.00th=[ 4256], 60.00th=[ 5664],
| 70.00th=[ 8160], 80.00th=[11840], 90.00th=[19328], 95.00th=[28032],
| 99.00th=[51968], 99.50th=[63744], 99.90th=[89600], 99.95th=[103936],
| 99.99th=[148480]
bw (KB /s): min= 231, max= 1061, per=1.55%, avg=513.75, stdev=98.50
lat (usec) : 100=0.19%, 250=5.80%, 500=19.22%, 750=1.58%, 1000=0.82%
lat (msec) : 2=4.63%, 4=16.07%, 10=27.74%, 20=14.44%, 50=8.40%
lat (msec) : 100=1.05%, 250=0.06%
cpu : usr=0.11%, sys=0.35%, ctx=83444, majf=0, minf=2203
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=83149/w=0/d=0, short=r=0/w=0/d=0 Run status group 0 (all jobs):
READ: io=332596KB, aggrb=33133KB/s, minb=33133KB/s, maxb=33133KB/s, mint=10038msec, maxt=10038msec Disk stats (read/write):
sda: ios=82814/13, merge=0/6, ticks=636982/30, in_queue=636949, util=98.87%
--filename

(待续)

fio——IO基准测试的更多相关文章

  1. Fio IO性能测试

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

  2. 【 sysbench 性能基准测试 】

    度娘解释:sysbench是一款开源的多线程性能测试工具,可以执行CPU/内存/线程/IO/数据库等方面的性能测试. 目前支持的数据库支持:MySQL,pgsql,oracle 这3种数据库. 安装s ...

  3. 【Linux】fio测试读写速度

    需要安装fio yum install fio -y 有很多依赖包     FIO用法: 随机读:(可直接用,向磁盘写一个2G文件,10线程,随机读1分钟,给出结果) fio -filename=/h ...

  4. 使用sysbench进行压力测试

    sysbench是一款开源的多线程性能测试工具,可以执行CPU/内存/线程/IO/数据库等方面的性能测试.数据库目前支持MySQL/Oracle/PostgreSQL/Drizzle,它主要包括以下几 ...

  5. sysbench 0.5使用手册

    注意:本文刚开始只介绍了sysbench 0.5之前的版本,在了解了sysbench 0.5之后进行了补充,大部分测试和参数都是一样的,只是sysbench 0.5 在测试数据库方面更加全面丰富. 关 ...

  6. pydicom读取dicom文件报错

    之前采用pydicom读取dicom文件一切都很正常,不过最近读取一批数据的时候,会报错 读取代码 file = pydicom.read_file(filepath) data = file.pix ...

  7. 高性能MySQL(二)

    MySQL基准测试 为什么需要benchmark 验证基于系统的假设,确认是否符合实际情况 重现系统中的某些异常行为,以解决它们 测试系统当前的运行情况,如果不清楚当前性能,就无法确认优化效果 模拟比 ...

  8. VS2015编译GEOS

    下载链接:http://trac.osgeo.org/geos/ 1. 打开cmake,加载geos源码和定位geos的工程存放位置: 2.点击configure,会报错,首先设置CMAKE_INST ...

  9. 《Linux内核精髓:精通Linux内核必会的75个绝技》一HACK #20 使用fio进行I/O的基准测试

    HACK #20 使用fio进行I/O的基准测试 本节介绍使用fio进行模拟各种情况的I/O基准测试的操作方法.I/O的基准测试中有无数需要考虑的因素.是I/O依次访问还是随机访问?是通过read/w ...

随机推荐

  1. Hadoop(四)HDFS集群详解

    前言 前面几篇简单介绍了什么是大数据和Hadoop,也说了怎么搭建最简单的伪分布式和全分布式的hadoop集群.接下来这篇我详细的分享一下HDFS. HDFS前言: 设计思想:(分而治之)将大文件.大 ...

  2. python celery 时区&结果(性能)的坑

    本文主要介绍最近使用celery遇到的两个坑.关于时区,以及是否保留结果(celery使用rabbitmq). 先说结论:定时任务记得配置时区:丢弃结果对使用rabbitmq对celery来说,性能提 ...

  3. Mybatis,Spring,SpringMVC框架面试题

    Mybatis测试 1,   Mybatis的核心是(  sqlsessionfactory    ) 2,   使用Mybatis持久化框架进行数据查询需要返回的一个实体类的集合, 在<sel ...

  4. oracle temporary table

    oralce 有两种临时表  a.会话级临时表 b.事物级临时表 A.事物级临时表 语法 create  global temporary table table_name( col1  type1, ...

  5. (转)java的动态代理机制详解

    原文出自:http://www.cnblogs.com/xiaoluo501395377/p/3383130.html 在学习Spring的时候,我们知道Spring主要有两大思想,一个是IoC,另一 ...

  6. 基于Hadoop(M/R)的MySQL到Oracle海量数据切割

    # 背景介绍 大数据时代,海量数据的迁移会很普遍地出现在各个应用场景,本文主要讨论利用Sqoop的分布式能力从关系型数据库MySQL到Oracle的海量数据迁移和切割. # 所需环境 1 JDK+Ec ...

  7. ps之雪碧图制作

    图片拖入后 一般取同行同列最高最宽 自动在所选目录生成 打开: 修改 四次请求有点多啊. 打开 css sprite 自动生成坐标地址. 不过我们要把它排远一点 OK了. 我们生成以后: 坐标地址就可 ...

  8. 66、django之模型层(model)--多表相关操作(图书管理小练习)

    前面几篇随笔的数据库增删改查操作都是在单表的操作上的,然而现实中不可能都是单表操作,更多的是多表操作,一对一,一对多,多对多的表结构才是我们经常需要处理的,本篇将带我们了解多表操作的一些相关操作.也会 ...

  9. 【Telerik控件学习】-制作3D效果的柱状图(ChartView)

    首先,定义柱状图,并设置自定义的DataTemplate <telerik:RadCartesianChart > <telerik:RadCartesianChart.Horizo ...

  10. iOS之 Category 属性 的理解

    在 Objective-C 中可以通过 Category 给一个现有的类添加属性,但是却不能添加实例变量 反正读第一遍的时候我是有点晕的,可以添加“属性”,然后又说“添加实例变量”,第一感觉就好像 有 ...