---
title: fio
description: "fio是一个开源的IO压力测试工具，主要用来测试存储的IO性能，可以支持多种引擎，本文测试时选用rbd引擎。fio配置灵活多样，支持多客户端并发测试（server、client模式）。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengsdss/testGuide/tstg/ceph-wjcc_cszd_007.html
sourcePath: /source/zh/kunpengsdss/testGuide/tstg/ceph-wjcc_cszd_007.html
indexId: cba65f6381f0fabd1787f7702a4738bb0a71515ec0fb33f24e0f8e6ebca9283d61
---
# fio

fio是一个开源的IO压力测试工具，主要用来测试存储的IO性能，可以支持多种引擎，本文测试时选用rbd引擎。fio配置灵活多样，支持多客户端并发测试（server、client模式）。

fio参数介绍如表1所示。


**表1 fio参数**

| 参数 | 含义 |
| --- | --- |
| ioengine | IO引擎 fio支持多种引擎如：cpuio、mmap、sync、psync、vsync、pvsync、pvsync2、null、net、netsplice、ftruncate、filecreate、libaio、posixaio、falloc、e4defrag、splice、rados、rbd、mtd、sg、io\_uring |
| clientname | Ceph用户 |
| pool | Ceph的存储池 |
| rbdname | Ceph RBD 镜像名 |
| direct | IO类型，direct=1表明采用non\-buffered io，direct=0表明采用buffered io |
| rw | 读写类型 rw=read：顺序读 rw=write：顺序写 rw=randread：随机读 rw=randwrite：随机写 rw=rw：顺序混合读写 rw=randrw：随机混合读写 |
| bs | IO块大小 |
| size | 读写的数据量 |
| iodepth | 队列深度 |
| numjobs | job副本数 |
| runtime | fio执行时间 |
| time\_based | 即使file已被完全读写或写完，也要执行完runtime规定的时间 |
| log\_avg\_msec | 设定日志采集间隔，单位为毫秒（ms） |
| ramp\_time | 在记录任何性能信息之前要运行特定负载的时间, 这个用来等性能稳定后，再记录日志结果，因此可以减少生成稳定的结果需要的运行时间 |
| thread | fio默认会使用fork()创建job，如果这个选项设置的话，fio将使用pthread\_create来创建线程 |
| rwmixread | 读写混合测试中读取占的百分比 |
| stonewall | 如果一个job文件里包含多个测试任务，加上这个参数会等上一个任务结束后再启动下一个任务 |


fio是一款比较成熟的测试工具，更多用法和参数可以参考用户手册(https://buildmedia.readthedocs.org/media/pdf/fio/latest/fio.pdf)。
