当前位置:网站首页>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)
边栏推荐
- Global and Chinese markets for recycled boilers 2022-2028: Research Report on technology, participants, trends, market size and share
- Use indent to format code
- Live555 RTSP audio and video streaming summary (II) modify RTSP server streaming URL address
- How to excavate and research ideas from the paper
- C WinForm [exit application] - practice 3
- Some tips for using source insight (solve the problem of selecting all)
- The research found that the cross-border e-commerce customer service system has these five functions!
- Relationship between line voltage and phase voltage, line current and phase current
- Sql Server的存儲過程詳解
- C WinForm [view status bar -- statusstrip] - Practice 2
猜你喜欢
Makefile application
Record the opening ceremony of Beijing Winter Olympics with display equipment
Markdown tips
Management and use of DokuWiki (supplementary)
C WinForm [help interface - send email] - practice five
Design a clock frequency division circuit that can be switched arbitrarily
Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine
Solutions to compilation warnings in Quartus II
Connection mode - bridge and net
Halcon's practice based on shape template matching [1]
随机推荐
STM32 tutorial triple ADC interleaved sampling
Extern keyword function
The printer encountered an abnormal configuration problem 0x8007007e (win10)
Drive LED -- GPIO control
C WinForm [view status bar -- statusstrip] - Practice 2
Circleq of linked list
How to excavate and research ideas from the paper
matlab timeserise
Tailq of linked list
Zero length array in GNU C
UEFI development learning 3 - create UEFI program
Development tools -- gcc compiler usage
After installing the new version of keil5 or upgrading the JLINK firmware, you will always be prompted about the firmware update
找不到实时聊天软件?给你推荐电商企业都在用的!
Measurement fitting based on Halcon learning [II] meaure_ pin. Hdev routine
Consul安装
动力电池UL2580测试项目包括哪些
【云原生 | 从零开始学Kubernetes】三、Kubernetes集群管理工具kubectl
C WinForm [help interface - send email] - practice five
Sizeof (function name) =?