Skip to content

Instantly share code, notes, and snippets.

@JulesWang
Last active December 28, 2015 04:29
Show Gist options
  • Save JulesWang/7442755 to your computer and use it in GitHub Desktop.
Save JulesWang/7442755 to your computer and use it in GitHub Desktop.

FIO

fio is an I/O tool meant to be used both for benchmark and stress/hardware verification.

Setup

Linux:

wget http://brick.kernel.dk/snaps/fio-2.1.2.tar.bz2
yum install libaio-devel 
tar -axvf fio-2.1.2.tar.bz2 
cd fio-2.1.2 
make 
make install

Windows: x86 | x86_64

How To Use

Refer to fio-2.1.2/HOWTO and fio-2.1.2/examples/*.fio

fio --help
fio --cmdhelp
fio --enghelp
下面是一些选项的中文解释:
filename=       测试文件名称,通常选择需要测试的盘的data目录。 
direct=1        测试过程绕过机器自带的buffer。使测试结果更真实。 
rw=randwrite    测试随机写的I/O 
rw=randrw       测试随机写和读的I/O 
bs=16k          单次io的块文件大小为16k 
bsrange=512-2048 同上,提定数据块的大小范围 
size=5g         本次的测试文件大小为5g,以每次4k的io进行测试。 
numjobs=30      本次的测试线程为30. 
runtime=1000    测试时间为1000秒,如果不写则一直将5g文件分4k每次写完为止。 
ioengine=psync  io引擎使用pync方式(共有13种方式)
rwmixwrite=30   在混合读写的模式下,写占30% 
group_reporting 关于显示结果的,汇总每个进程的信息。 
lockmem=1g      只使用1g内存进行测试。 
zero_buffers    用0初始化系统buffer。 
nrfiles=8       每个进程生成文件的数量。

Notes

There are two examples for testing ssd in the examples dir.

  • ssd-steadystate.fio
  • ssd-test.fio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment