Table of Contents
Install" >Install
illustrate" >illustrate
Home Computer Tutorials Computer Knowledge Practical combat: hard disk io read and write test on Linux

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

Feb 19, 2024 pm 03:40 PM
io Read and write fio

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 随机混合读写
Copy after login

Install

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

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 每个进程生成文件的数量。
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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

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 of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

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

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1667
14
PHP Tutorial
1273
29
C# Tutorial
1255
24
How to solve 'undefined: io.ReadAll' error in golang? How to solve 'undefined: io.ReadAll' error in golang? Jun 25, 2023 am 10:01 AM

During the development process using Golang, we often encounter some errors. One of them is "undefined:io.ReadAll", this error is mostly caused by using outdated methods. This article will explain how to resolve this error. First, let's look at why this error occurs. Before golang1.15, there was no ReadAll method in the io package. When we use this method, the compiler will prompt "undefined:io.Re

How to use PHP to implement data caching, reading and writing functions How to use PHP to implement data caching, reading and writing functions Sep 05, 2023 pm 05:45 PM

How to use PHP to implement data caching and read-write functions. Caching is an important way to improve system performance. Through caching, frequently used data can be stored in memory to increase the reading speed of data. In PHP, we can use various methods to implement data caching and reading and writing functions. This article will introduce two common methods: using file caching and using memory caching. 1. Use file caching. File caching stores data in files for subsequent reading. The following is a sample code that uses file caching to read and write data:

What does linux io mean? What does linux io mean? Mar 24, 2023 am 09:43 AM

Linux io refers to a file operation; in Linux, a file is a series of binary streams, so during the exchange of information, we all perform data sending and receiving operations on these streams. These operations are referred to as I/O operations; because Linux uses a virtual memory mechanism, so the kernel must be requested through system calls to complete IO operations.

How to solve 'undefined: io.TeeReader' error in golang? How to solve 'undefined: io.TeeReader' error in golang? Jun 25, 2023 am 09:51 AM

When developing with golang, we often encounter various problems and error messages. One of the common problems is the "undefined:io.TeeReader" error. This error usually occurs when the program is compiled, and sometimes it can be frustrating. This article will introduce how to solve this problem so that you can smoothly carry out golang development work. First, let's look at what exactly this error means. when we are using

Practical combat: hard disk io read and write test on Linux Practical combat: hard disk io read and write test on Linux Feb 19, 2024 pm 03:40 PM

Concept fio, also known as FlexibleIOTester, is an application written by JensAxboe. Jens is the maintainer of blockIOsubsystem in LinuxKernel. 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. rw=[mode]rwmixwrite=30 In mixed read and write mode, writing accounts for 30% moderead sequential read write sequential write readwrite sequential mixed read and write randwrite random write r

Use the io/ioutil.WriteFile function to write a string to a file and set file permissions and indentation format Use the io/ioutil.WriteFile function to write a string to a file and set file permissions and indentation format Jul 24, 2023 pm 06:21 PM

Use the io/ioutil.WriteFile function to write a string to a file, and set the file permissions and indentation format. In the Go language, you can easily write a string to a file using the WriteFile function in the io/ioutil package. At the same time, we can also set file permissions and indentation format to meet different needs. Here is a sample code that demonstrates how to use the WriteFile function to write to a file and set permissions and indentation format: packagemainim

How does Java use NIO to optimize IO to implement file upload and download functions? How does Java use NIO to optimize IO to implement file upload and download functions? May 12, 2023 pm 09:31 PM

1. Some basic preparatory knowledge of NIO. BIO and NIO in the system of IO stream class in Java: https://blog.csdn.net/ZGL_cyy/article/details/104326458. JavaIO system and NIO and BIO system interview questions: https://blog. csdn.net/ZGL_cyy/article/details/122836368Why use NIO: Because the traditional IO file transfer rate is low, NIO is chosen for file download operations. Another advantage of NIO is that zero copy can reduce the duplication of data in memory and reduce the effect of CPU operations. Place

Revealing the inner workings of Java file operations Revealing the inner workings of Java file operations Feb 28, 2024 am 08:22 AM

File System APIThe internal principles of Java file operations are closely related to the file system API of the operating system. In Java, file operations are provided by the java.nio.file module in the java.NIO package. This module provides an encapsulation of the file system API, allowing Java developers to use a unified API to perform file operations on different operating systems. File Object When a Java program needs to access a file, it first needs to create a java.nio.file.Path object. The Path object represents a path in the file system, which can be an absolute path or a relative path. Once the Path object is created, you can use it to get various properties of the file, such as the name

See all articles