当前位置:网站首页>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)
边栏推荐
- Factors affecting the quality of slip rings in production
- 导电滑环磨损快的原因
- Count and sort the occurrence times of specific fields through SQL statements
- [professional literacy] specific direction of analog integrated circuits
- General makefile (I) single C language compilation template
- Carrier period, electrical speed, carrier period variation
- Sql Server的存儲過程詳解
- Measurement fitting based on Halcon learning [i] fuse Hdev routine
- Introduction of air gap, etc
- Use indent to format code
猜你喜欢
Cadence simulation encountered "input.scs": can not open input file change path problem
Improve lighting C program
【论文阅读】2022年最新迁移学习综述笔注(Transferability in Deep Learning: A Survey)
Introduction of air gap, etc
After installing the new version of keil5 or upgrading the JLINK firmware, you will always be prompted about the firmware update
Altium designer learning (I)
Class of color image processing based on Halcon learning_ ndim_ norm. hdev
Screen record of the opening ceremony of the Beijing winter olympics 2
如何将EasyCVR平台RTSP接入的设备数据迁移到EasyNVR中?
Development tools -- gcc compiler usage
随机推荐
About yolov3, conduct map test directly
Hardware 1 -- relationship between gain and magnification
C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program
Record the opening ceremony of Beijing Winter Olympics with display equipment
Baiwen 7-day smart home learning experience of Internet of things
如何进行导电滑环选型
【论文阅读】2022年最新迁移学习综述笔注(Transferability in Deep Learning: A Survey)
Some tips for using source insight (solve the problem of selecting all)
Semiconductor devices (I) PN junction
Shape template matching based on Halcon learning [viii] PM_ multiple_ models. Hdev routine
Naming rules for FreeRTOS
How to define guid in AMI code
Interview catalogue
Use indent to format code
Programming knowledge -- basis of C language
Extern keyword function
Explain task scheduling based on Cortex-M3 in detail (Part 1)
Cadence learning records
WiFi wpa_ Detailed description of supplicant hostpad interface
Relationship between line voltage and phase voltage, line current and phase current