一、fio介绍

fio 是一个I/O工具用来对硬件进行压力测试和验证,是一款Linux平台上颇为专业的磁盘性能测试工具,其测试数据十分具有参考价值。支持13种不同的I/O引擎,包括:sync, mmap, libaio, posixaio, SG v3, splice, null, network, syslet, guasi, solarisaio等等, I/O priorities (for newer Linux kernels), rate I/O, forked or threaded jobs等。

二、安装

这里使用的是源码包安装。下载地址:

链接: http://pan.baidu.com/s/1ntpyXfj 密码: odgq

这里使用的系统是RedHat 6或CentOs 6

首先,需要安装gcc编译器,搭建好yum源,yum install gcc* 确定安装即可。

把fio上传到Linux系统中,注意,使用ftp上传的时候,需使用binary二进制模式

为了避免权限问题,可以把fio文件权限改为755,chmod 755 fio-2.1.7.tar.gz

tar -zxvf fio-2.1.7.tar.gz//解压

cd fio-2.1.7

./configure

make

make install

装好即可。

[root@zhou ~]# fio

No jobs(s) defined

fio-2.1.7

fio [options] [job options]

--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

三、使用方法

▲随机读:

fio -filename=/dev/sdb1 -direct=1 -iodepth 1 -thread -rw=randread -ioengine=psync -bs=16k -size=200G -numjobs=10 -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/sdb1 -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=16k -size=200G -numjobs=30 -runtime=1000 -group_reporting -name=mytest

▲随机写:

fio -filename=/dev/sdb1 -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=16k -size=200G -numjobs=30 -runtime=1000 -group_reporting -name=mytest

▲顺序写:

fio -filename=/dev/sdb1 -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=16k -size=200G -numjobs=30 -runtime=1000 -group_reporting -name=mytest

▲混合随机读写:

fio -filename=/dev/sdb1 -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命令linux,fio安装和使用方法相关推荐

  1. linux中安装卸载命令,Linux软件安装与卸载命令

    ./configure         检查系统信息 ./configure   --help   |   more     帮助信息 make   clean           清除之前留下的文件 ...

  2. linux安装gcc命令步骤(centos安装gcc命令)

    linux安装gcc命令步骤(centos安装gcc命令) >一.前言 本文介绍在CentOS7.8系统下使用YUM升级GCC版本的相关操作步骤. CentOS7默认安装的gcc版本是4.8版本 ...

  3. linux rsync yum安装,Linux安装yum安装rsync 、Linux编译安装最新版rsync

    Loading... # Linux安装yum安装rsync .Linux编译安装最新版rsync ## 针对CentOS采用 yum 安装 ### 安装 ``` yum install rsync ...

  4. anconda安装后命令行中安装tensorflow报错

    现象  anconda安装后命令行中安装tensorflow报错 pip install --upgrade --ignore-installed tensorflow-gpu Building wh ...

  5. Linux编译安装qt5.9,Linux CentOS7 安装 Qt 5.9.2

    Linux CentOS7 安装 Qt 5.9.2 参考链接 http://doc.qt.io/qt-5/linux.html sudo yum groupinstall "C Develo ...

  6. 安装fio命令linux,如何在Linux中使用Fio来测评硬盘性能

    Fio(Flexible I/O Tester) 是一款由 Jens Axboe 开发的用于测评和压力/硬件验证的自由开源的软件. 它支持 19 种不同类型的 I/O 引擎 (sync.mmap.li ...

  7. 安装fio命令linux,Linux中fio命令起什么作用呢?

    摘要: 下文讲述Linux中fio的功能说明,如下所示: fio 它是IOPS测试一个工具 fio命令功能: 用于对磁盘进行压力测试和验证 fio命令注意事项: fio可产生大量的线程或进程运行 一些 ...

  8. linux 安装删除命令,Linux如何使用命令行卸载安装包

    导读 严格地说,Linux是内核.Linux发行版由Linux内核.安装脚本.shell.编译器.桌面和其他组件组成.因此,卸载包或软件的Linux命令取决于Linux发行版的名称和类型.本文说明如何 ...

  9. linux的安装nmom命令,Linux下块设备查看命令lsblk详解

    简介 在Linux系统下面,块设备使用很常见,尤其是一些传统商用数据库,例如Oracle,DB2就经常使用块设备,lsblk命令可以非常方便的让你获取所有的块设备信息. lsblk安装 如果你的Lin ...

最新文章

  1. 【ACM】杭电OJ 2010
  2. You're AllSet! 以多重集函数角度重新检视超图GNN
  3. java ssh框架 struts spring hibernate 简介
  4. 暑期周总结四(2018.7.30-2018.8.5)
  5. babel 转换箭头函数
  6. 【Python 爬虫】 1、爬虫基础概念
  7. c语言程序设计运用,清华大学出版社-图书详情-《C语言程序设计及应用教程》...
  8. java jndi使用_Java项目中使用JNDI连接数据库
  9. Kettle入门--作业和转换的使用
  10. worknc的后处理如何安装_如何选择永磁变频螺杆空压机的冷干机?
  11. linux mysql5.6.30 配置_Linux(Red Hat 6 32位) 下安装Mysql5.6.30
  12. 滚动时间选择器recyclerview_Android自定义可循环的滚动选择器CycleWheelView
  13. html alert 确认加事件,js事件中有alert执行顺序的问题
  14. 机器学习:理解逻辑回归及二分类、多分类代码实践
  15. unity3D与网页的交互---做项目的一点总结
  16. 分布式存储系统学习笔记(一)—什么是分布式系统(7)—跨机房部署的三种方案
  17. 中国联通沃支付echop支付插件
  18. SAR成像(一):线性调频信号(LFM)和脉冲压缩
  19. 电力拖动(工厂电气控制)实验装置
  20. C语言实战--DDOS攻击器

热门文章

  1. 一个空格引发的“惨案“
  2. 疫情病毒全部“抹杀”?用数据模型来解读传播抑制的效果差异!
  3. 推荐系统如何一键实现工业级部署? ElasticCTR 百度开讲
  4. 揭秘支撑双 11 买买买背后的硬核黑科技!
  5. 12 种主流编程语言输出“ Hello World ”,你真的都会了吗?
  6. Eclipse 有望超越 Visual Studio!
  7. Google Fuchsia 对中国操作系统的启示 | 畅言
  8. 深入浅出 Proguard
  9. 重磅开源!《阿里巴巴Android开发手册》抢鲜下载!
  10. 作为一名开发者,没有实力和运气能干什么?