官方网站:
http://freecode.com/projects/fio
简介:
fio is an I/O tool meant to be used both for benchmark and stress/hardware verification. It has support for 19 different types of I/O engines (sync, mmap, libaio, posixaio, SG v3, splice, null, network, syslet, guasi, solarisaio, and more), I/O priorities (for newer Linux kernels), rate I/O, forked or threaded jobs, and much more. It can work on block devices as well as files. fio accepts job descriptions in a simple-to-understand text format. Several example job files are included. fio displays all sorts of I/O performance information, including complete IO latencies and percentiles. Fio is in wide use in many places, for both benchmarking, QA, and verification purposes. It supports Linux, FreeBSD, NetBSD, OpenBSD, OS X, OpenSolaris, AIX, HP-UX, Android, and Windows.
安装(以CentOS6为例):
1.yum安装(确保有epel源)
yum –y install fio
2.源码安装
yum –y install gcc gcc-c++ make libaio-devel
wget http://brick.kernel.dk/snaps/fio-2.2.6.tar.bz2
tar –xvf fio-2.2.6.tar.bz2 –C /usr/local/src
cd /usr/local/src/fio-2.2.6
make && make install
测试方法:
1.顺序读(read)
fio -filename=/dev/vdb -direct=1 -iodepth 128
-thread
SSD iodepth用128,普通云主机iodepth用64,numjobs用1就可以,否则测出来数据会偏大,bs需要512K以上
fio -filename=/dev/vdb -direct=1 -iodepth 128
-thread
SSD iodepth用128,普通云主机iodepth用64,numjobs不用太大,bs需512K以上
fio -filename=/dev/vdb -direct=1 -iodepth 128
-thread
bs根据测试的块大小进行调整(随机主要看4K,8K),SSD numjobs为128,普通云主机用4或8就可以了
fio -filename=/dev/vdb -direct=1 -iodepth 128
-thread
bs根据测试的块大小进行调整(随机主要看4K,8K),SSD numjobs为32,普通云主机用4或8就可以了,numjobs太大的话反而会带来副作用
fio -filename=/dev/vdb -direct=1 -iodepth 128
-thread
fio -filename=/dev/vdb -direct=1 -iodepth 128
-thread
SSD iodepth用128,普通云主机用64
混合读写的比例调整-rwmixread就可以了,100表示全是读,0表示全是写,50表示一半读一半写,根据需要调整。目前混合读写最好引导用户直接测裸盘,如果测文件的话会暴露出来我们的读IO较差,且读IO过多会导致写IO性能下降。
还可以通过以下配置静默测试后通过plot绘制图表
[global]
ioengine=libaio
iodepth=128
time_based
direct=1
thread=1
group_reporting
randrepeat=0
norandommap
numjobs=32
timeout=6000
runtime=120
[randread-4k]
rw=randread
bs=4k
filename=/dev/sdg
rwmixread=100
stonewall
[randwrite-4k]
rw=randwrite
bs=4k
filename=/dev/sdg
stonewall
[read-512k]
rw=read
bs=512k
filename=/dev/sdg
stonewall
[write-512k]
rw=write
bs=512k
filename=/dev/sdg
stonewall
|