使用fio测试磁盘I/O性能
简介:
fio是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎,包括:sync,mmap, libaio, posixaio, SG v3, splice, null, network, syslet, guasi, solarisaio 等等。
安装fio:
官网网站:http://brick.kernel.dk/snaps/
wget http://brick.kernel.dk/snaps/fio-2.2.10.tar.gz (从官网下载fio的tar包)
tar -zxvf fio-2.2..tar.gz (解压)
cd fio-2.2.
make && make install (安装)
yum install libaio-devel (为了支持同步I/O)
fio分随机读,随机写,顺序读,顺序写,混合随机读写模式。
fio参数:
filename=/dev/sdb #测试文件(设备)的名称,通常选择需要测试的data目录(可以通过冒号分割同时指定多个文件,如filename=/dev/sda:/dev/sdb。) direct= #测试过程绕过机器自带的buffer(缓冲区),使测试结果更真实 rw=randwrite · #测试随机写的I/O rw=randread #测试随机读的I/O rw=randrw #测试随机读写的I/O bs=4k #单次I/O的块文件大小为4K size=20G #本次测试的文件大小为20G,以每次4K的I/O进行测试 numjobs= #本次的测试线程为30个 runtime= #测试时间为600秒,如果不写,则一直将20G文件分每次4K写完为止 ioengine=psync #I/O引擎使用psync方式(I/O引擎,现在fio支持19种ioengine。默认值是sync同步阻塞I/O,libaio是Linux的native异步I/O。关于同步异步,阻塞和非阻塞模型可以参考文章“使用异步 I/O 大大提高应用程序的性能”。
http://www.ibm.com/developerworks/cn/linux/l-async/) group_reporting #关于显示结果的,汇总每个进程的信息 name #指定job的名字,在命令行中表示新启动一个job。 iodepth #如果ioengine采用异步方式,该参数表示一批提交保持的io单元数。(该参数可参考文章“Fio压测工具和io队列深度理解和误区”。http://blog.yufeng.info/archives/2104) thread #线程
fio实例:
随机读4K: fio -filename=/dev/sdb:/dev/sdc:/dev/sdd -direct= -iodepth= -thread -rw=randread -ioengine=libaio -bs=4k -size=20G -numjobs= -runtime= -group_reporting -name=mytest 随机写4K: fio -filename=/dev/sdb:/dev/sdc:/dev/sdd -direct= -iodepth= -thread -rw=randwrite -ioengine=libaio -bs=4k -size=20G -numjobs= -runtime= -group_reporting -name=mytest 顺序读1M: fio -filename=/dev/sdb:/dev/sdc:/dev/sdd -direct= -iodepth= -thread -rw=read -ioengine=libaio -bs=1M -size=20G -numjobs= -runtime= -group_reporting -name=mytest 顺序写1M: fio -filename=/dev/sdb:/dev/sdc:/dev/sdd -direct= -iodepth= -thread -rw=write -ioengine=libaio -bs=1M -size=20G -numjobs= -runtime= -group_reporting -name=mytest 混合随机读写: fio -filename=/dev/sdb:/dev/sdc:/dev/sdd -direct= -iodepth -thread -rw=randrw -rwmixread= -ioengine=psync -bs=16k -size=200G -numjobs= -runtime= -group_reporting -name=mytest -ioscheduler=noop
实例测试:
注:主要关注结果用橙色标出
4k随机读:
[root@localhost ~]# fio -filename=/dev/sda:/dev/sdb:/dev/sdc -direct= -iodepth -thread -rw=randread -ioengine=libaio -bs=4k -size=20G -numjobs= -runtime= -group_reporting -name=mytest
mytest: (g=): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=
...
fio-2.21
Starting threads
Jobs: (f=): [r()][100.0%][r=.2MiB/s,w=0KiB/s][r=,w= IOPS][eta 00m:00s]
mytest: (groupid=, jobs=): err= : pid=: Thu Jun ::
read: IOPS=, BW=.8MiB/s (.3MB/s)(1077MiB/100033msec)
slat (usec): min=, max=, avg=21.55, stdev= 9.74
clat (usec): min=, max=, avg=10853.67, stdev=12909.46
lat (usec): min=, max=, avg=10875.94, stdev=12909.57
clat percentiles (usec):
| .00th=[ ], .00th=[ ], .00th=[ ], .00th=[ ],
| .00th=[ ], .00th=[ ], .00th=[ ], .00th=[],
| .00th=[], .00th=[], .00th=[], .00th=[],
| .00th=[], .50th=[], .90th=[], .95th=[],
| .99th=[]
bw ( KiB/s): min= , max= , per=0.00%, avg=369.92, stdev=100.81
lat (usec) : =0.11%, =0.12%, =0.27%
lat (msec) : =2.59%, =9.55%, =43.26%, =37.74%, =5.51%
lat (msec) : =0.63%, =0.20%, =0.01%, =0.01%
cpu : usr=0.09%, sys=0.32%, ctx=, majf=, minf=
IO depths : =100.0%, =0.0%, =0.0%, =0.0%, =0.0%, =0.0%, >==0.0%
submit : =0.0%, =100.0%, =0.0%, =0.0%, =0.0%, =0.0%, >==0.0%
complete : =0.0%, =100.0%, =0.0%, =0.0%, =0.0%, =0.0%, >==0.0%
issued rwt: total=,,, short=,,, dropped=,,
latency : target=, window=, percentile=100.00%, depth= Run status group (all jobs):
READ: bw=.8MiB/s (.3MB/s), .8MiB/s-.8MiB/s (.3MB/s-.3MB/s), io=1077MiB (1129MB), run=-100033msec Disk stats (read/write):
sda: ios=/, merge=/, ticks=/, in_queue=, util=92.52%
sdb: ios=/, merge=/, ticks=/, in_queue=, util=84.34%
sdc: ios=/, merge=/, ticks=/, in_queue=, util=91.21%
混合随机读写:
[root@localhost ~]# fio -filename=/dev/sda:/dev/sdb:/dev/sdc -direct= -iodepth -thread -rw=randrw -ioengine=libaio -bs=4k -size=20G -numjobs= -runtime= -group_reporting -name=mytest
mytest: (g=): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=
...
fio-2.21
Starting threads
Jobs: (f=): [m()][100.0%][r=404KiB/s,w=464KiB/s][r=,w= IOPS][eta 00m:00s]
mytest: (groupid=, jobs=): err= : pid=: Thu Jun ::
read: IOPS=, BW=345KiB/s (353kB/s)(.7MiB/100117msec)
slat (usec): min=, max=, avg=30.70, stdev=11.21
clat (usec): min=, max=, avg=50031.54, stdev=79240.40
lat (usec): min=, max=, avg=50063.31, stdev=79240.09
clat percentiles (usec):
| .00th=[ ], .00th=[ ], .00th=[ ], .00th=[ ],
| .00th=[ ], .00th=[ ], .00th=[], .00th=[],
| .00th=[], .00th=[], .00th=[], .00th=[],
| .00th=[], .50th=[], .90th=[], .95th=[],
| .99th=[]
bw ( KiB/s): min= , max= , per=0.01%, avg=18.68, stdev=12.27
write: IOPS=, BW=344KiB/s (352kB/s)(.6MiB/100117msec)
slat (usec): min=, max=, avg=34.27, stdev=15.34
clat (msec): min=, max=, avg=297.95, stdev=232.05
lat (msec): min=, max=, avg=297.99, stdev=232.05
clat percentiles (msec):
| .00th=[ ], .00th=[ ], .00th=[ ], .00th=[ ],
| .00th=[ ], .00th=[ ], .00th=[ ], .00th=[ ],
| .00th=[ ], .00th=[ ], .00th=[ ], .00th=[ ],
| .00th=[ ], .50th=[ ], .90th=[ ], .95th=[ ],
| .99th=[ ]
bw ( KiB/s): min= , max= , per=0.00%, avg=13.50, stdev= 6.61
lat (usec) : =0.02%, =0.48%, =0.67%
lat (msec) : =5.84%, =5.92%, =10.74%, =7.24%, =9.34%
lat (msec) : =10.07%, =23.98%, =17.14%, =5.98%, =1.94%
lat (msec) : =0.64%
cpu : usr=0.01%, sys=0.03%, ctx=, majf=, minf=
IO depths : =100.0%, =0.0%, =0.0%, =0.0%, =0.0%, =0.0%, >==0.0%
submit : =0.0%, =100.0%, =0.0%, =0.0%, =0.0%, =0.0%, >==0.0%
complete : =0.0%, =100.0%, =0.0%, =0.0%, =0.0%, =0.0%, >==0.0%
issued rwt: total=,,, short=,,, dropped=,,
latency : target=, window=, percentile=100.00%, depth= Run status group (all jobs):
READ: bw=345KiB/s (353kB/s), 345KiB/s-345KiB/s (353kB/s-353kB/s), io=.7MiB (.4MB), run=-100117msec
WRITE: bw=344KiB/s (352kB/s), 344KiB/s-344KiB/s (352kB/s-352kB/s), io=.6MiB (.3MB), run=-100117msec Disk stats (read/write):
sda: ios=/, merge=/, ticks=/, in_queue=, util=100.00%
sdb: ios=/, merge=/, ticks=/, in_queue=, util=99.66%
sdc: ios=/, merge=/, ticks=/, in_queue=, util=99.90%
硬盘性能指标:
顺序读写 (吞吐量,常用单位为MB/s):文件在硬盘上存储位置是连续的。
适用场景:大文件拷贝(比如视频音乐)。速度即使很高,对数据库性能也没有参考价值。
4K随机读写 (IOPS,常用单位为次):在硬盘上随机位置读写数据,每次4KB。
适用场景:操作系统运行、软件运行、数据库。
使用fio测试磁盘I/O性能的更多相关文章
- [记录]FIO测试磁盘iops性能
FIO测试磁盘iops性能 1.SATA和SAS盘原生IOPS如下: 2.RAID磁盘阵列对应的写惩罚级别: 3.计算功能性IOPS公式如下: 功能性 IOPS=(((总原生 IOPS×写 %))/( ...
- linux使用FIO测试磁盘的iops 【转载】
linux使用FIO测试磁盘的iops 2013-09-23 10:59:21 分类: LINUX FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎,包括 ...
- vdbench和fio测试磁盘性能的对比总结
一.安装 1.安装vdbench,首先安装java:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-213 ...
- fio 测试磁盘
root@rook-test:/# ceph osd status+----+-----------------------------+-------+-------+--------+------ ...
- fio 测试磁盘性能
在磁盘测试中最关心的几个指标分别为: iops(每秒执行的IO次数).bw(带宽,每秒的吞吐量).lat(每次IO操作的延迟). 当每次IO操作的block较小时,如512bytes/4k/8k等,测 ...
- CentOS中使用FIO测试磁盘IO性能
$ yum install fio 0x02 命令 随机读: $ fio -filename=/dev/sda1 -direct=1 -iodepth 1 -thread -rw=randread - ...
- FIO 测试磁盘iops 以及读写
最近在做mariadb的性能,感觉io 有瓶颈,就使用fio 来测试一下磁盘.下文为转载文章(温馨提示:此命令很伤硬盘,测试前请备份数据,- -我就写坏了一个.) FIO 是测试IOPS的非常好的工具 ...
- 使用FIO测试磁盘iops
我们如何衡量一个存储的性能呢?IOPS(Input/Output OperationsPer Second),即每秒进行读写(I/O)操作的次数是国际上通用的存储性能衡量标准,IOPS越高意味着在同一 ...
- linux 使用FIO测试磁盘iops 方法详解
FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎, 包括:sync,mmap, libaio, posixaio, SG v3, splice, null, ...
随机推荐
- Java字节码分析
目录 Java字节码分析 查看字节码详细内容 javap 实例分析 Java字节码分析 对于源码的效率,但从源码来看有时无法分析出准确的结果,因为不同的编译器版本可能会将相同的源码编译成不同的字节码, ...
- Lodop套打
记录一下Lodop套打模板 实现打印功能需电脑已经连接打印机(打印什么类型的东西就连接相应的打印机 (普通大打印机 打印标签 打印发票各种打印机))和已经安装好lodop控件 控件可到官网进行下载 h ...
- Error: EPERM: operation not permitted,
转载自:https://blog.csdn.net/dong923700243/article/details/78989332 npm ERR! path E:\React\ReactNativeP ...
- Java中的构造函数——通过示例学习Java编程(14)
作者:CHAITANYA SINGH 来源:https://www.koofun.com//pro/kfpostsdetail?kfpostsid=25 构造函数是用来初始化新创建的对象的代码块. ...
- springboot集成shiro实现权限缓存和记住我
到这节为止,我们已经实现了身份验证和权限验证.但是,如果我们登录之后多次访问http://localhost:8080/userInfo/userDel的话,会发现权限验证会每次都执行一次.这是有问题 ...
- vue使用uglifyjs-webpack-plugin后打包报错
楼主最新对已做项目进行打包优化,配置了打包环境下去除console.log语句插件---使用uglifyjs-webpack-plugin具体代码如下 npm install uglifyjs-web ...
- jQuery动态追加移除CSS样式
jQuery基础知识,动态添加删除CSS样式 <!DOCTYPE html> <html lang="en"> <head> <meta ...
- Python3基础02(列表和字符串处理)
str = 'Runoob'# 输出字符串print(str) # 输出第一个到倒数第二个的所有字符print(str[0:-1]) # 输出字符串第一个字符print(str[0]) # 输出从第三 ...
- 洛谷 P1426 小鱼会有危险吗
题目描述 有一次,小鱼要从A处沿直线往右边游,小鱼第一秒可以游7米,从第二秒开始每秒游的距离只有前一秒的98%.有个极其邪恶的猎人在距离A处右边s米的地方,安装了一个隐蔽的探测器,探测器左右x米之内是 ...
- 利用jieba第三方库对文件进行关键字提取
已经爬取到的斗破苍穹文本以TXT形式存储 代码 import jieba.analyse path = 'C:/Users/Administrator/Desktop/bishe/doupo.text ...