0

0

实战:Linux上硬盘io读写测试

WBOY

WBOY

发布时间:2024-02-19 15:40:16

|

1646人浏览过

|

来源于每日运维

转载

概念

fio,又称为Flexible IO Tester,是Jens Axboe编写的应用程序。 Jens是Linux Kernel中block IO subsystem的维护者。 FIO是一种用于测试网络文件系统和磁盘性能的工具,常用于验证机型和比较文件系统性能。它能自动将fio命令发送到集群机器列表,并收集小文件的IOPS和大文件的吞吐量数据。

实战:linux上硬盘io读写测试

rw=[mode]
rwmixwrite=30 在混合读写的模式下,写占30%

mode
read 顺序读
write 顺序写
readwrite 顺序混合读写
randwrite 随机写
randread 随机读
randrw 随机混合读写

安装

yumdownloader --destdir=/tmp --resolve fio
rpm -ivh /tmp/*.rpm
rpm -ivh fio-3.7-2.el7.x86_64.rpm

说明

说明:
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 --name=wbw --filename=/data/sui_ji_xie --numjobs=4 
--bs=128k --size=4G --ioengine=libaio --direct=1 --randrepeat=0 --norandommap --rw=randwrite 
--group_reporting --iodepth=512 --iodepth_batch=128 --iodepth_batch_complete=128 --gtod_reduce=1 --runtime=30

测试4K 随机写延迟:

fio --name=wlat --filename=/data/4k_sui_ji_xie --numjobs=1 --runtime=30 
--bs=4k --size=4G --ioengine=libaio --direct=1 --norandommap --randrepeat=0 
-rw=randwrite --group_reporting --iodepth=1 --iodepth_batch_complete=0

测试4k 随机写IOPS:

fio --name=wiops --filename=/data/4k_sui_ji_xie_iops --numjobs=4 
--bs=4k --size=4G --ioengine=libaio --direct=1 --randrepeat=0 --norandommap 
--rw=randwrite --group_reporting --iodepth=512 --iodepth_batch=128 
--iodepth_batch_complete=128 --gtod_reduce=1 --runtime=30

测试4k 读带宽:

fio --name=rbw --filename=/data/4k_sui_ji_du --numjobs=4 
--bs=128k --size=4G --ioengine=libaio --direct=1 --randrepeat=0 --norandommap 
--rw=randread --group_reporting --iodepth=512 --iodepth_batch=128 
--iodepth_batch_complete=128 --gtod_reduce=1 --runtime=30

测试4k 随机读延迟:

fio --name=rlat --filename=/data/4k_sui_ji_du_yanchi --numjobs=1 --runtime=30 
--bs=4k --size=4G --ioengine=libaio --direct=1 --randrepeat=0 --rw=randread 
--group_reporting --iodepth=1 --iodepth_batch_complete=0

测试4k 随机读IOPS:

Replit Ghostwrite
Replit Ghostwrite

一种基于 ML 的工具,可提供代码完成、生成、转换和编辑器内搜索功能。

下载
fio --name=riops --filename=/data/4k_sui_ji_du_iops --numjobs=4 
--bs=4k --size=4G --ioengine=libaio --direct=1 --randrepeat=0 --norandommap --rw=randread 
--group_reporting --iodepth=512 --iodepth_batch=128 --iodepth_batch_complete=128 --gtod_reduce=1 --runtime=30

随机读:

fio -filename=/data/sui_ji_du -iodepth=1 -ioengine=libaio -direct=1 -rw=randread -bs=4k -size=1G -numjobs=10 -runtime=20 -group_reporting -name=test-rand-read

随机写:

fio -filename=/data/sui_ji_xie -iodepth=64 -ioengine=libaio -direct=1 -rw=randwrite -bs=4k -size=2G -numjobs=64 -runtime=20 -group_reporting -name=test-rand-write

顺序读:

fio -filename=/data/shun_xu_du -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=16k -size=20G -numjobs=30 -runtime=1000 -group_reporting -name=mytest

混合随机读写:

fio -filename=/data/hun_he_du_xie -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=16k -size=10G -numjobs=30 -runtime=100 -group_reporting -name=mytest -ioscheduler=noop
io=执行了多少M的IO
bw=平均IO带宽
iops=IOPS
runt=线程运行时间
slat=提交延迟
clat=完成延迟
lat=响应时间
bw=带宽
cpu=利用率
IO depths=io队列
IO submit=单个IO提交要提交的IO数
IO complete=Like the above submit number, but for completions instead.
IO issued=The number of read/write requests issued, and how many of them were short.
IO latencies=IO完延迟的分布

io=总共执行了多少size的IO
aggrb=group总带宽
minb=最小.平均带宽.
maxb=最大平均带宽.
mint=group中线程的最短运行时间.
maxt=group中线程的最长运行时间.

ios=所有group总共执行的IO数.
merge=总共发生的IO合并数.
ticks=Number of ticks we kept the disk busy.
in_queue=花费在队列上的总共时间.
util=磁盘利用率

相关文章

相关标签:

本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

相关专题

更多
磁盘配额是什么
磁盘配额是什么

磁盘配额是计算机中指定磁盘的储存限制,就是管理员可以为用户所能使用的磁盘空间进行配额限制,每一用户只能使用最大配额范围内的磁盘空间。php中文网为大家提供各种磁盘配额相关的内容,教程,供大家免费下载安装。

1352

2023.06.21

如何安装LINUX
如何安装LINUX

本站专题提供如何安装LINUX的相关教程文章,还有相关的下载、课程,大家可以免费体验。

704

2023.06.29

linux find
linux find

find是linux命令,它将档案系统内符合 expression 的档案列出来。可以指要档案的名称、类别、时间、大小、权限等不同资讯的组合,只有完全相符的才会被列出来。find根据下列规则判断 path 和 expression,在命令列上第一个 - ( ) , ! 之前的部分为 path,之后的是 expression。还有指DOS 命令 find,Excel 函数 find等。本站专题提供linux find相关教程文章,还有相关

294

2023.06.30

linux修改文件名
linux修改文件名

本专题为大家提供linux修改文件名相关的文章,这些文章可以帮助用户快速轻松地完成文件名的修改工作,大家可以免费体验。

776

2023.07.05

linux系统安装教程
linux系统安装教程

linux系统是一种可以免费使用,自由传播,多用户、多任务、多线程、多CPU的操作系统。本专题提供linux系统安装教程相关的文章,大家可以免费体验。

573

2023.07.06

linux查看文件夹大小
linux查看文件夹大小

Linux是一种自由和开放源码的类Unix操作系统,存在着许多不同的Linux版本,但它们都使用了Linux内核。Linux可安装在各种计算机硬件设备中,比如手机、平板电脑、路由器、视频游戏控制台、台式计算机、大型机和超级计算机。linux怎么查看文件夹大小呢?php中文网给大家带来了相关的教程以及文章,欢迎大家前来学习阅读。

547

2023.07.20

linux查看ip命令
linux查看ip命令

本专题为大家提供linux查看ip命令相关文章内容,感兴趣的朋友可以免费下载体验试试。

297

2023.07.20

linux查看cpu使用率
linux查看cpu使用率

在linux的系统维护中,可能需要经常查看cpu使用率,分析系统整体的运行情况。本专题为大家带来了linux查看cpu使用率的相关文章,感兴趣的朋友千万不要错过了。

381

2023.07.25

菜鸟裹裹入口以及教程汇总
菜鸟裹裹入口以及教程汇总

本专题整合了菜鸟裹裹入口地址及教程分享,阅读专题下面的文章了解更多详细内容。

0

2026.01.22

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
golang和swoole核心底层分析
golang和swoole核心底层分析

共3课时 | 0.1万人学习

Python 并发编程实战
Python 并发编程实战

共12课时 | 0.7万人学习

Golang进阶实战编程
Golang进阶实战编程

共34课时 | 2.7万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号