fio でdisk のパフォーマンス測定

install

libaio-devel がいる。

# yum install libaio-devel
# wget http://brick.kernel.dk/snaps/fio-2.0.7.tar.gz
# tar zxvf fio-2.0.7.tar.gz
# cd fio-2.0.7
# make && make install
追記

epelにあったのでそこから入れてもいいかな。

# yum install --enablerepo=epel fio


実行

パラメータは引数で指定するか、ini形式のファイルに書いてそれを読み込むか。

# fio hoge.ini
# fio -filename=/tmp/data -direct=1 -rw=read -bs=4k -size=10G \
  -group_reporting -name=file1 -numjobs=4 -runtime=60 \
  -output=fio.txt
# cat fio.txt
file1: (g=0): rw=randwrite, bs=4K-4K/4K-4K, ioengine=sync, iodepth=1
...
file1: (g=0): rw=randwrite, bs=4K-4K/4K-4K, ioengine=sync, iodepth=1
fio 2.0.7
Starting 64 processes

file1: (groupid=0, jobs=64): err= 0: pid=26500
  write: io=9496.0KB, bw=949043 B/s, iops=231 , runt= 10246msec
    clat (msec): min=1 , max=737 , avg=137.67, stdev=143.36
     lat (msec): min=1 , max=737 , avg=137.67, stdev=143.36
    clat percentiles (usec):
     |  1.00th=[ 1880],  5.00th=[ 2640], 10.00th=[ 3152], 20.00th=[ 3952],
     | 30.00th=[ 4512], 40.00th=[ 5024], 50.00th=[ 5664], 60.00th=[257024],
     | 70.00th=[261120], 80.00th=[264192], 90.00th=[272384], 95.00th=[280576],
     | 99.00th=[561152], 99.50th=[659456], 99.90th=[716800], 99.95th=[733184],
     | 99.99th=[733184]
    bw (KB/s)  : min=    3, max=  285, per=1.43%, avg=13.26, stdev=22.88
    lat (msec) : 2=1.60%, 4=19.17%, 10=30.08%, 20=0.13%, 50=0.04%
    lat (msec) : 250=2.23%, 500=45.45%, 750=1.31%
  cpu          : usr=0.00%, sys=0.01%, ctx=5954, majf=0, minf=2049
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued    : total=r=0/w=2374/d=0, short=r=0/w=0/d=0

Run status group 0 (all jobs):
  WRITE: io=9496KB, aggrb=926KB/s, minb=926KB/s, maxb=926KB/s, mint=10246msec, maxt=10246msec

Disk stats (read/write):
    dm-0: ios=0/2355, merge=0/0, ticks=0/10148, in_queue=10151, util=98.29%, aggrios=0/2380, aggrmerge=0/4, aggrticks=0/1022
5, aggrin_queue=10223, aggrutil=98.19%
  sda: ios=0/2380, merge=0/4, ticks=0/10225, in_queue=10223, util=98.19%
  • rw

read, write, randread, randwrite, readwrite, randrw
randがついているものはrandom IO
ついてないものはsequential IO

  • direct

defaultは0。1にするとnon-bufferd (O_DIRECT)になる。
disk自体のパフォーマンスを測定したいなら-direct=1 にしないとダメ。

  • output

出力結果をファイルに保存。指定しなかったらstdoutに。

  • numjobs

thread数

  • runtime

実行時間 (sec)