当前位置:网站首页>FIO测试硬盘性能参数和实例详细总结(附源码)
FIO测试硬盘性能参数和实例详细总结(附源码)
2022-07-05 08:09:00 【快乐的学习】
目录
一、简介
本文主要介绍FIO的具体参数、源码下载及通过实例进行FIO硬盘性能测试,FIO是Linux下开源的一款IOPS测试工具,主要用来对磁盘进行压力测试和性能验证。
它可以产生许多线程或进程来执行用户特定类型的I/O操作,通过编写作业文件(类似于k8s的yaml)或者直接命令去执行测试动作,相当于是一个多线程的io生成工具,用于生成多种IO模式来测试硬盘设备的性能(大多情况用于测试裸盘性能)。
二、源码下载及参数解析
2.1 源码下载方式
1、git直接下载
https://github.com/axboe/fio.git
[[email protected] /]# wget https://github.com/axboe/fio/archive/refs/tags/fio-3.10.zip
[[email protected] /]# cd /root/fio-fio-3.10
[[email protected] /]# ./configure
[[email protected] /]# make && make install
2、部分系统源中已有fio包
[[email protected] /]# apt-get install fio -y //直接下载
2.2 参数解析
参数 | 解析 |
---|---|
-name | 用于输出信息用的名字,在上述命令行的使用方法中,表明一个新job的开始,缺省为job name |
-filename | 测试文件名称,通常选择需要测试的盘的data目录 |
-group_reporting | 汇总所有的信息,而不是每个job都显示具体的结果 |
-iodepth | 本次测试的队列深度 |
-ioengine | 负载产生的引擎,定义job向文件发起io的方式。Fio的引擎有很多,具体可以网上搜一下,常用的引擎为libaio 和 |
-volume 和 -brick | 这两个是测试挂载点用的,其他场景不需要。 |
-nrfiles | 每个进程生成的文件数量 |
-rw | 读写方式,顺序读,顺序写,随机读,随机写,混合读写 |
-bs | 块大小,一般测试4k, 8k, 64k, 128k, 1M |
-size | 测试文件的大小 |
-threads | fio默认会使用fork()创建job,如果这个选项设置的话,fio将使用pthread_create来创建线程 |
-numjobs | 创建的线程数量 |
-direct | 测试过程绕过机器自带的buffer或cache,相当于o_direct其他一些相对高级点用法的参数,比如:-runtime测试时长 |
-bssplit=4k/40:64k/30:1M/30 | 混合块大小,4k:64k:1M = 4:3:3 |
bsrange=512-2048 | 块大小的范围,同bs参数 |
-rw=randrw, -rwmixread=70 | 混合读写7:3 |
FIO测试前注意事项:
1、测试环境配置
yum -y install libaio-devel //安装libaio引擎,不然执行fio会报“fio: engine libaio not loadable”,必须要在fio安装前安装,不然还要重新编译安装一遍fio
2、写测试时注意是操作裸盘还是有数据的盘,因为写操作会将硬盘已有数据格式化掉,如果要测已经分区、并创建文件系统,且已写入数据的磁盘上进行性能测试,请注意filename选择指定文件,以避免覆盖文件系统和原有数据。
2.3 测试实例
读性能测试
fio -filename=/dev/sda -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=16k -size=20G -numjobs=30 -runtime=1000 -group_reporting -name=yaoxu-sda
//测试sda的裸盘性能,-direct=1绕过机器的cache,队列深度为1,块大小为16k,测试文件的 大小为20G,创建30个线程,测试时长为1000s
测试结果:
写性能测试
fio -filename=/dev/sda -direct=1 -iodepth 256 -thread=1 -rw=write -ioengine=libaio -bs=128k -size=5G -numjobs=4 -runtime=60 -group_reporting -name=eric-test
测试结果:
三、其他相关链接
3.1 Linux下stream内存带宽测试总结附源码
3.2 Linux下区分磁盘(HDD)和固态硬盘(SSD)
边栏推荐
- Soem EtherCAT source code analysis II (list of known configuration information)
- Network communication process
- Correlation based template matching based on Halcon learning [II] find_ ncc_ model_ defocused_ precision. hdev
- Compilation warning solution sorting in Quartus II
- Stablq of linked list
- How to excavate and research ideas from the paper
- Improve lighting C program
- Live555 push RTSP audio and video stream summary (I) cross compilation
- Management and use of DokuWiki (supplementary)
- Drive LED -- GPIO control
猜你喜欢
LED display equipment records of the opening ceremony of the Beijing Winter Olympics
Development tools -- gcc compiler usage
Factors affecting the quality of slip rings in production
My-basic application 2: my-basic installation and operation
Relationship between line voltage and phase voltage, line current and phase current
[trio basic tutorial 17 from getting started to mastering] set up and connect the trio motion controller and input the activation code
Circleq of linked list
Consul安装
The printer encountered an abnormal configuration problem 0x8007007e (win10)
Carrier period, electrical speed, carrier period variation
随机推荐
LED display equipment records of the opening ceremony of the Beijing Winter Olympics
Imx6ull bare metal development learning 1-assembly lit LED
How to migrate the device data accessed by the RTSP of the easycvr platform to easynvr?
Count and sort the occurrence times of specific fields through SQL statements
Ads learning record (lna_atf54143)
Vofa+ software usage record
How to define guid in AMI code
C#,数值计算(Numerical Recipes in C#),线性代数方程的求解,LU分解(LU Decomposition)源程序
Step motor generates S-curve upper computer
List of linked lists
C WinForm [change the position of the form after running] - Practical Exercise 4
String judgment
Matlab2018b problem solving when installing embedded coder support package for stmicroelectronic
[tutorial 15 of trio basic from introduction to proficiency] trio free serial communication
UEFI development learning 4 - getting to know variable services
Basic embedded concepts
Some errors in configuring the environment
Gradle composite construction
Makefile application
Programming knowledge -- assembly knowledge