search
HomeComputer TutorialsComputer KnowledgePractical combat: hard disk io read and write test on Linux

concept

fio, also known as Flexible IO Tester, is an application written by Jens Axboe.

Jens is the maintainer of the block IO subsystem in the Linux Kernel.

FIO is a tool used to test network file system and disk performance. It is often used to verify machine models and compare file system performance. It automatically sends fio commands to a list of cluster machines and collects IOPS for small files and throughput data for large files.

Practical combat: hard disk io read and write test on Linux

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

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

Install

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

illustrate

说明:
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 每个进程生成文件的数量。

Test random write bandwidth

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

Test 4K random write delay:

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

Test 4k random write 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

Test 4k read bandwidth:

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

Test 4k random read latency:

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

Test 4k random read IOPS:

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

Random reading:

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

Write randomly:

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

Sequential reading:

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

Mixed random read and write:

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=磁盘利用率

The above is the detailed content of Practical combat: hard disk io read and write test on Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:每日运维. If there is any infringement, please contact admin@php.cn delete
Top 5 Solutions to Valorant Connection Error Windows 10/11 - MiniToolTop 5 Solutions to Valorant Connection Error Windows 10/11 - MiniToolMay 13, 2025 am 12:54 AM

Valorant has encountered a connection error when gaming? What will you do when that happens on PC? Take it easy. Every problem has a fix. Valorant is also no exception. In this article on php.cn Website, I bet you must find satisfying solutions.

How to Remove PUA:Win32/FlashHelper on Windows 10/11?How to Remove PUA:Win32/FlashHelper on Windows 10/11?May 13, 2025 am 12:53 AM

What to do if you see a message saying that PUA:Win32/FlashHelper was located on your PC? Do you know what it is? This is a potentially unwanted software and might threaten your data and system. Once your computer is infected by it, follow this guide

Fix Some Common Chrome Connection Errors while Browsing a Website - MiniToolFix Some Common Chrome Connection Errors while Browsing a Website - MiniToolMay 13, 2025 am 12:51 AM

In this post, php.cn Software lists some common Chrome connection errors you might encounter when browsing a webpage and introduces some easy methods to solve these issues. You can find the error you encounter and use the corresponding solutions to h

What Are Cookies on the Internet? Are Cookies Bad? - MiniToolWhat Are Cookies on the Internet? Are Cookies Bad? - MiniToolMay 13, 2025 am 12:50 AM

Cookies may not sound new to you because you encounter them almost every day when you browse web pages. But do you know what exactly cookies are? This guide on php.cn Website will show you detailed information about them.

How to Print Photos/Documents from iPhone to HP Printer in 3 Ways - MiniToolHow to Print Photos/Documents from iPhone to HP Printer in 3 Ways - MiniToolMay 13, 2025 am 12:49 AM

If you want to print photos from iPhone, what should you do? The operation is not difficult as long as you follow three ways in this post. php.cn will show you a detailed guide on how to print from iPhone to HP printer. Now, let’s go to see them.

How To Make The Xbox Download Faster: Tips & Methods - MiniToolHow To Make The Xbox Download Faster: Tips & Methods - MiniToolMay 13, 2025 am 12:48 AM

Xbox is very popular among people since it offers a large variety of games. Users can download the games they like and then start to play them directly. However, one of the common problems related to Xbox is the slow download speed. Users want to fin

Can't Turn on Developer Mode in Windows 11? Fix It via 4 Ways! - MiniToolCan't Turn on Developer Mode in Windows 11? Fix It via 4 Ways! - MiniToolMay 13, 2025 am 12:47 AM

If you are a developer, you may enable Developer Mode in Settings to do some tests. However, if you can’t turn on Developer Mode in Windows 11, what should you do? Take it easy and you can find some effective ways from this post written by php.cn Sol

Windows 10 KB5011543 Is Released with Search Highlights Feature - MiniToolWindows 10 KB5011543 Is Released with Search Highlights Feature - MiniToolMay 13, 2025 am 12:46 AM

Microsoft has released a new cumulative update for Windows 10 and it is Windows 10 KB5011543. This update contains some new features like Search highlights and some fixes. You can read this php.cn post to get some related information. Besides, you ca

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use