小型计算机系统接口(SCSI,Small Computer System Interface)

SAS(Serial Attached SCSI,串列SCSI)

SCSI 硬盘名称: sd[a-p]

sda1、sda2又分别代表不同分区(Partition)

1. 进入/sys/block/sda/queue/, 查看磁盘sda的参数

 ls - /sys/block/sda/queue/ | awk '{cmd="cat "i$0; print i$0; system(cmd) }' i=`pwd`'/'

/sys/block/sda/queue/add_random
1
/sys/block/sda/queue/discard_granularity
0
/sys/block/sda/queue/discard_max_bytes
0
/sys/block/sda/queue/discard_zeroes_data
0
/sys/block/sda/queue/hw_sector_size
512
/sys/block/sda/queue/iosched
cat: /sys/block/sda/queue/iosched: 是一个目录
/sys/block/sda/queue/iostats
1
/sys/block/sda/queue/logical_block_size
512
/sys/block/sda/queue/max_hw_sectors_kb
32767
/sys/block/sda/queue/max_integrity_segments
0
/sys/block/sda/queue/max_sectors_kb

/sys/block/sda/queue/max_segments
128
/sys/block/sda/queue/max_segment_size
65536
/sys/block/sda/queue/minimum_io_size
4096
/sys/block/sda/queue/nomerges
0
/sys/block/sda/queue/nr_requests
128
/sys/block/sda/queue/optimal_io_size
0
/sys/block/sda/queue/physical_block_size
4096
/sys/block/sda/queue/read_ahead_kb
128
/sys/block/sda/queue/rotational
1
/sys/block/sda/queue/rq_affinity
1
/sys/block/sda/queue/scheduler
noop deadline [cfq]
/sys/block/sda/queue/unpriv_sgio
0
/sys/block/sda/queue/write_same_max_bytes

scsi设备列表

lsscsi -l
[0:0:0:0] disk ATA ST1000DM003-1ER1 CC46 /dev/sda
state=running queue_depth=1 scsi_level=6 type=0 device_blocked=0 timeout=30

执行fio命令时,先确保改磁盘没有数据,不然数据会被覆盖

fio --name=randwrite --rw=randwrite --bs=4k --size=20G --runtime=1200 --ioengine=libaio --iodepth=16 --numjobs=1 --filename=/dev/sda --direct=1 --group_reporting

filename=/dev/sda 测试文件名称,通常选择需要测试的盘的data目录。 
direct=1 测试过程绕过机器自带的buffer。使测试结果更真实。 
rw=randwrite 测试随机写的I/O 
rw=randrw 测试随机写和读的I/O 
bs=4k 单次io的块文件大小为4k 
bsrange=512-2048 同上,提定数据块的大小范围 
size=5g 本次的测试文件大小为5g,以每次4k的io进行测试。 
numjobs=30 本次的测试线程为30. 
runtime=1200 测试时间为1200秒
ioengine=psync io引擎使用pync方式 
rwmixwrite=30 在混合读写的模式下,写占30% 
group_reporting 汇总每个进程的信息。 
lockmem=1g 只使用1g内存进行测试。 
zero_buffers 用0初始化系统buffer。 
nrfiles=8 每个进程生成文件的数量。

runtime=int

Terminate processing after the specified number of seconds.

filename=str

fio normally makes up a file name based on the job name, thread number, and file number. If you want to share files between threads in a job or several jobs, specify a filename for each of them to override the default. If the I/O engine is file-based, you can specify a number of files by separating the names with a ':' character. '-' is a reserved name, meaning stdin or stdout, depending on the read/write direction set.

iodepth=int

Number of I/O units to keep in flight against the file. Note that increasing iodepth beyond 1 will not affect synchronous ioengines (except for small degress when verify_async is in use). Even async engines my impose OS restrictions causing the desired depth not to be achieved. This may happen on Linux when using libaio and not setting direct=1, since buffered IO is not async on that OS. Keep an eye on the IO depth distribution in the fio output to verify that the achieved depth is as expected. Default: 1.

然后观察iostat输出

iostat -mtx 2

2018年01月22日 16时54分33秒
avg-cpu: %user %nice %system %iowait %steal %idle
1.01 0.00 0.51 25.25 0.00 73.23 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sda 1.50 0.00 3.00 183.50 0.12 0.71 9.09 18.11 101.74 177.67 100.50 5.36 100.00

rrqms:每秒这个设备相关的读取请求有多少被Merge了(读取数据时,VFS将请求发到各个FS,如果FS发现不同的读取请求读取的是相同Block的数据,FS会将这个请求合并Merge)

wrqm/s:每秒这个设备相关的写入请求有多少被Merge了。

rsec/s:The number of sectors read from the device per second.

wsec/s:The number of sectors written to the device per second.

rKB/s:The number of kilobytes read from the device per second.

wKB/s:The number of kilobytes written to the device per second.

avgrq-sz:The average size (in sectors) of the requests that were issued to the device. (平均请求扇区数)

avgqu-sz: The average queue length of the requests that were issued to the device.  (平均请求队列的长度)

await:每一个IO请求的响应时间(队列时间+服务时间),一般地系统IO响应时间应该低于5ms

svctm:表示平均每次设备I/O操作的服务时间。如果await的值远高于svctm的值,则表示I/O队列等待太长。

%util: 在统计时间内所有处理IO时间,除以总共统计时间。

参考:

fio使用指南

深入理解iostate

fio 测试 磁盘I/O: ls -1 /sys/block/sda/queue/ | awk '{cmd="cat "i$0; print i$0; system(cmd) }' i=`pwd`'/'的更多相关文章

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

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

  2. [记录]FIO测试磁盘iops性能

    FIO测试磁盘iops性能 1.SATA和SAS盘原生IOPS如下: 2.RAID磁盘阵列对应的写惩罚级别: 3.计算功能性IOPS公式如下: 功能性 IOPS=(((总原生 IOPS×写 %))/( ...

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

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

  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. linux 使用FIO测试磁盘iops 方法详解

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

  7. vdbench和fio测试磁盘性能的对比总结

    一.安装 1.安装vdbench,首先安装java:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-213 ...

  8. fio 测试磁盘

    root@rook-test:/# ceph osd status+----+-----------------------------+-------+-------+--------+------ ...

  9. FIO测试磁盘的iops

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

随机推荐

  1. [Bayes] Understanding Bayes: Visualization of the Bayes Factor

    From: https://alexanderetz.com/2015/08/09/understanding-bayes-visualization-of-bf/ Nearly被贝叶斯因子搞死,找篇 ...

  2. 大杂烩 -- ArrayList的动态增长 源码分析

    基础大杂烩 -- 目录 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 问题:当ArrayList中放入的元素一直增加会如 ...

  3. mkvirtualenv command not found解决

    在京东云上用户家目录下创建.virtualenvs后,创建python虚拟环境,使用mkvirtualenv命令,没有提示,输完回车报下面错误,mkvirtualenv command not fou ...

  4. 【netcore基础】.NET Core使用EPPlus实现MVC API里的Excel导出功能 配置中文表头

    EPPlus 用来操作excel非常方便,不用依赖微软的office包,所以推荐使用. 下面是具体步骤和代码 首先用nuget安装 EPPlus.Core 我装的版本是 1.5.4 然后就可以用 Ex ...

  5. solus 系统 - 安装编译工具

    将会安装 gcc,make等工具 sudo eopkg install -c system.devel VirtualBox工具 https://solus-project.com/articles/ ...

  6. <target>.ID 和 <source>.ID 的属性冲突: DataType 属性不匹配

    ORACLE数据库主键的数据类型为number ,如果不指定长度会有 Merge报 <target>.ID 和 <source>.ID 的属性冲突: DataType 属性不匹 ...

  7. 使用ELK收集分析MySQL慢查询日志

    参考文档:https://www.cnblogs.com/bixiaoyu/p/9638505.html MySQL开启慢查询不详述 MySQL5.7慢查询日志格式如下 /usr/local/mysq ...

  8. myEclipse异常:Subversion Native Library Not Available

    参考文档:https://blog.csdn.net/zp357252539/article/details/44880319 Subversion Native Library Not Availa ...

  9. 洛谷 P1583魔法照片 & P1051谁拿了最多奖学金 & P1093奖学金

    题目:https://www.luogu.org/problemnew/show/P1583 思路:sort sort sort //#include<bits/stdc++.h> #in ...

  10. cvLogPolar函数详解

    对于二维图形,Log-polar转换表示从笛卡尔坐标到极坐标的变化,广泛应用在计算机视觉中.此函数模仿人类视网膜中央凹视力,并且对于目标跟踪等可用于快速尺度和旋转变换不变模板匹配. 本例程实现极坐标变 ...