当前位置:网站首页>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)
边栏推荐
- Process communication mode between different hosts -- socket
- UEFI development learning series
- Improve lighting C program
- [tutorial 15 of trio basic from introduction to proficiency] trio free serial communication
- Semiconductor devices (III) FET
- Relationship between line voltage and phase voltage, line current and phase current
- Tailq of linked list
- My-basic application 2: my-basic installation and operation
- Soem EtherCAT source code analysis attachment 1 (establishment of communication operation environment)
- Carrier period, electrical speed, carrier period variation
猜你喜欢

Stablq of linked list

The research found that the cross-border e-commerce customer service system has these five functions!

Programming knowledge -- assembly knowledge
![[tutorial 15 of trio basic from introduction to proficiency] trio free serial communication](/img/08/7f28008a4aa999650998ba8dee5d8e.jpg)
[tutorial 15 of trio basic from introduction to proficiency] trio free serial communication

STM32 tutorial triple ADC interleaved sampling

H264 (I) i/p/b frame gop/idr/ and other parameters

Semiconductor devices (I) PN junction

Ble encryption details

Embedded composition and route

Shell script basic syntax
随机推荐
Live555 RTSP audio and video streaming summary (II) modify RTSP server streaming URL address
[trio basic from introduction to mastery tutorial 20] trio calculates the arc center and radius through three points of spatial arc
Hardware and software solution of FPGA key chattering elimination
Tailq of linked list
[trio basic tutorial 17 from getting started to mastering] set up and connect the trio motion controller and input the activation code
C#,数值计算(Numerical Recipes in C#),线性代数方程的求解,LU分解(LU Decomposition)源程序
Development tools -- gcc compiler usage
H264 (I) i/p/b frame gop/idr/ and other parameters
Verilog -- state machine coding method
Halcon's practice based on shape template matching [1]
Random function usage notes
Gradle复合构建
Improve lighting C program
Bootloader implementation of PIC MCU
Use indent to format code
Basic information commands and functions of kernel development
Consul安装
Explain task scheduling based on Cortex-M3 in detail (Part 2)
IC software learning
IEEE access personal contribution experience record