読者です 読者をやめる 読者になる 読者になる

5400rpm

人生シングルスレッド

fioの小ネタ(出力編)

fioの出力系オプション

  • ネット上でfioの使い方を検索すると、ベンチマーク結果の出力整形の話が多い

    • いくつかは標準のオプションで解決できる問題なので --output-format オプションを紹介する
  • 今回のバージョンは fio-2.13-18-gc915

[comicsong@comicsong ~]$ fio --help | grep -E "^fio|output-format|mini"
fio-2.13-18-gc915
fio [options] [job options] <job file(s)>
  --minimal             Minimal (terse) output
  --output-format=x     Output format (terse,json,json+,normal)
  • 出力を見るのが目的なのでベンチは軽い/短いで設定
[global]
directory=/mnt/SSD/fio/tmp/
size=5m
numjobs=4
iodepth=1
time_based
runtime=5
overwrite=1
ioengine=libaio
bs=4k
group_reporting
direct=1

[test]
  • -rw 引数なしで実行するのでテストはseq_read

標準/オプションなし

test: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=1
...
fio-2.13-18-gc915
Starting 4 processes
Jobs: 4 (f=4): [R(4)] [66.7% done] [73336KB/0KB/0KB /s] [18.4K/0/0 iops] [eta 00Jobs: 4 (f=4): [R(4)] [83.3% done] [72624KB/0KB/0KB /s] [18.2K/0/0 iops] [eta 00Jobs: 4 (f=4): [R(4)] [100.0% done] [72480KB/0KB/0KB /s] [18.2K/0/0 iops] [eta 00m:00s]
test: (groupid=0, jobs=4): err= 0: pid=25959: Wed Aug  3 22:44:09 2016
  read : io=370192KB, bw=74024KB/s, iops=18505, runt=  5001msec
    slat (usec): min=5, max=59, avg= 9.72, stdev= 3.58
    clat (usec): min=131, max=343, avg=203.95, stdev=31.97
     lat (usec): min=153, max=355, avg=213.98, stdev=32.32
    clat percentiles (usec):
     |  1.00th=[  151],  5.00th=[  159], 10.00th=[  167], 20.00th=[  175],
     | 30.00th=[  183], 40.00th=[  191], 50.00th=[  201], 60.00th=[  211],
     | 70.00th=[  221], 80.00th=[  233], 90.00th=[  247], 95.00th=[  258],
     | 99.00th=[  290], 99.50th=[  298], 99.90th=[  314], 99.95th=[  318],
     | 99.99th=[  334]
    bw (KB  /s): min=17840, max=19368, per=25.06%, avg=18549.78, stdev=465.42
    lat (usec) : 250=91.59%, 500=8.41%
  cpu          : usr=2.10%, sys=6.54%, ctx=92564, majf=0, minf=143
  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=92548/w=0/d=0, short=r=0/w=0/d=0, drop=r=0/w=0/d=0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
   READ: io=370192KB, aggrb=74023KB/s, minb=74023KB/s, maxb=74023KB/s, mint=5001msec, maxt=5001msec

Disk stats (read/write):
  sda: ios=90630/0, merge=0/0, ticks=18010/0, in_queue=17969, util=97.98%

terse/minimal

  • ; 区切り。IOPSは8カラム目
[comicsong@comicsong fio]$ fio fio.ini --output-format=terse
3;fio-2.13-18-gc915;test;0;0;366944;73374;18343;5001;5;56;9.908498;3.603938;137;391;205.598816;32.887238;1.000000%=151;5.000000%=159;10.000000%=167;20.000000%=175;30.000000%=185;40.000000%=193;50.000000%=203;60.000000%=213;70.000000%=223;80.000000%=235;90.000000%=249;95.000000%=262;99.000000%=294;99.500000%=302;99.900000%=318;99.950000%=326;99.990000%=350;0%=0;0%=0;0%=0;153;398;215.846941;33.153533;17016;19080;24.954949%;18310.444444;586.622120;0;0;0;0;0;0;0.000000;0.000000;0;0;0.000000;0.000000;1.000000%=0;5.000000%=0;10.000000%=0;20.000000%=0;30.000000%=0;40.000000%=0;50.000000%=0;60.000000%=0;70.000000%=0;80.000000%=0;90.000000%=0;95.000000%=0;99.000000%=0;99.500000%=0;99.900000%=0;99.950000%=0;99.990000%=0;0%=0;0%=0;0%=0;0;0;0.000000;0.000000;0;0;0.000000%;0.000000;0.000000;2.305000%;6.635000%;91755;0;143;100.0%;0.0%;0.0%;0.0%;0.0%;0.0%;0.0%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;90.27%;9.73%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;sda;89909;0;0;0;18050;0;18016;97.98%

json

{
  "fio version" : "fio-2.13-18-gc915",
  "timestamp" : 1470231466,
  "timestamp_ms" : 1470231466406,
  "time" : "Wed Aug  3 22:37:46 2016",
  "global options" : {
    "directory" : "/mnt/SSD/fio/tmp/",
    "size" : "5m",
    "iodepth" : "1",
    "runtime" : "5",
    "overwrite" : "1",
    "ioengine" : "libaio",
    "bs" : "4k",
    "direct" : "1"
  },
  "jobs" : [
    {
      "jobname" : "test",
      "groupid" : 0,
      "error" : 0,
      "eta" : 0,
      "elapsed" : 6,
      "read" : {
        "io_bytes" : 373880,
        "bw" : 74761,
        "iops" : 18690.261719,
        "runtime" : 5001,
        "total_ios" : 93470,
        "short_ios" : 0,
        "drop_ios" : 0,
        "slat" : {
          "min" : 5,
          "max" : 56,
          "mean" : 9.981598,
          "stddev" : 3.579818
        },
        "clat" : {
          "min" : 129,
          "max" : 371,
          "mean" : 201.493454,
          "stddev" : 30.615873,
          "percentile" : {
            "1.000000" : 151,
            "5.000000" : 157,
            "10.000000" : 165,
            "20.000000" : 173,
            "30.000000" : 181,
            "40.000000" : 189,
            "50.000000" : 199,
            "60.000000" : 207,
            "70.000000" : 219,
            "80.000000" : 231,
            "90.000000" : 245,
            "95.000000" : 255,
            "99.000000" : 278,
            "99.500000" : 290,
            "99.900000" : 306,
            "99.950000" : 310,
            "99.990000" : 322,
            "0.00" : 0,
            "0.00" : 0,
            "0.00" : 0
          }
        },
        "lat" : {
          "min" : 151,
          "max" : 390,
          "mean" : 211.806931,
          "stddev" : 31.008247
        },
        "bw_min" : 18312,
        "bw_max" : 19072,
        "bw_agg" : 24.960133,
        "bw_mean" : 18660.445312,
        "bw_dev" : 232.786407
      },
      "write" : {
        "io_bytes" : 0,
        "bw" : 0,
        "iops" : 0.000000,
        "runtime" : 0,
        "total_ios" : 0,
        "short_ios" : 0,
        "drop_ios" : 0,
        "slat" : {
          "min" : 0,
          "max" : 0,
          "mean" : 0.000000,
          "stddev" : 0.000000
        },
        "clat" : {
          "min" : 0,
          "max" : 0,
          "mean" : 0.000000,
          "stddev" : 0.000000,
          "percentile" : {
            "1.000000" : 0,
            "5.000000" : 0,
            "10.000000" : 0,
            "20.000000" : 0,
            "30.000000" : 0,
            "40.000000" : 0,
            "50.000000" : 0,
            "60.000000" : 0,
            "70.000000" : 0,
            "80.000000" : 0,
            "90.000000" : 0,
            "95.000000" : 0,
            "99.000000" : 0,
            "99.500000" : 0,
            "99.900000" : 0,
            "99.950000" : 0,
            "99.990000" : 0,
            "0.00" : 0,
            "0.00" : 0,
            "0.00" : 0
          }
        },
        "lat" : {
          "min" : 0,
          "max" : 0,
          "mean" : 0.000000,
          "stddev" : 0.000000
        },
        "bw_min" : 0,
        "bw_max" : 0,
        "bw_agg" : 0.000000,
        "bw_mean" : 0.000000,
        "bw_dev" : 0.000000
      },
      "trim" : {
        "io_bytes" : 0,
        "bw" : 0,
        "iops" : 0.000000,
        "runtime" : 0,
        "total_ios" : 0,
        "short_ios" : 0,
        "drop_ios" : 0,
        "slat" : {
          "min" : 0,
          "max" : 0,
          "mean" : 0.000000,
          "stddev" : 0.000000
        },
        "clat" : {
          "min" : 0,
          "max" : 0,
          "mean" : 0.000000,
          "stddev" : 0.000000,
          "percentile" : {
            "1.000000" : 0,
            "5.000000" : 0,
            "10.000000" : 0,
            "20.000000" : 0,
            "30.000000" : 0,
            "40.000000" : 0,
            "50.000000" : 0,
            "60.000000" : 0,
            "70.000000" : 0,
            "80.000000" : 0,
            "90.000000" : 0,
            "95.000000" : 0,
            "99.000000" : 0,
            "99.500000" : 0,
            "99.900000" : 0,
            "99.950000" : 0,
            "99.990000" : 0,
            "0.00" : 0,
            "0.00" : 0,
            "0.00" : 0
          }
        },
        "lat" : {
          "min" : 0,
          "max" : 0,
          "mean" : 0.000000,
          "stddev" : 0.000000
        },
        "bw_min" : 0,
        "bw_max" : 0,
        "bw_agg" : 0.000000,
        "bw_mean" : 0.000000,
        "bw_dev" : 0.000000
      },
      "usr_cpu" : 2.220000,
      "sys_cpu" : 6.885000,
      "ctx" : 93490,
      "majf" : 0,
      "minf" : 143,
      "iodepth_level" : {
        "1" : 100.000000,
        "2" : 0.000000,
        "4" : 0.000000,
        "8" : 0.000000,
        "16" : 0.000000,
        "32" : 0.000000,
        ">=64" : 0.000000
      },
      "latency_us" : {
        "2" : 0.000000,
        "4" : 0.000000,
        "10" : 0.000000,
        "20" : 0.000000,
        "50" : 0.000000,
        "100" : 0.000000,
        "250" : 92.976357,
        "500" : 7.023644,
        "750" : 0.000000,
        "1000" : 0.000000
      },
      "latency_ms" : {
        "2" : 0.000000,
        "4" : 0.000000,
        "10" : 0.000000,
        "20" : 0.000000,
        "50" : 0.000000,
        "100" : 0.000000,
        "250" : 0.000000,
        "500" : 0.000000,
        "750" : 0.000000,
        "1000" : 0.000000,
        "2000" : 0.000000,
        ">=2000" : 0.000000
      },
      "latency_depth" : 1,
      "latency_target" : 0,
      "latency_percentile" : 100.000000,
      "latency_window" : 0
    }
  ],
  "disk_util" : [
    {
      "name" : "sda",
      "read_ios" : 91549,
      "write_ios" : 0,
      "read_merges" : 0,
      "write_merges" : 0,
      "read_ticks" : 17987,
      "write_ticks" : 0,
      "in_queue" : 17953,
      "util" : 97.959999
    }
  ]
}

json+

{
  "fio version" : "fio-2.13-18-gc915",
  "timestamp" : 1470231404,
  "timestamp_ms" : 1470231404065,
  "time" : "Wed Aug  3 22:36:44 2016",
  "global options" : {
    "directory" : "/mnt/SSD/fio/tmp/",
    "size" : "5m",
    "iodepth" : "1",
    "runtime" : "5",
    "overwrite" : "1",
    "ioengine" : "libaio",
    "bs" : "4k",
    "direct" : "1"
  },
  "jobs" : [
    {
      "jobname" : "test",
      "groupid" : 0,
      "error" : 0,
      "eta" : 0,
      "elapsed" : 6,
      "read" : {
        "io_bytes" : 364952,
        "bw" : 72975,
        "iops" : 18243.951172,
        "runtime" : 5001,
        "total_ios" : 91238,
        "short_ios" : 0,
        "drop_ios" : 0,
        "slat" : {
          "min" : 5,
          "max" : 54,
          "mean" : 10.069456,
          "stddev" : 3.672873
        },
        "clat" : {
          "min" : 134,
          "max" : 399,
          "mean" : 206.593155,
          "stddev" : 35.088558,
          "percentile" : {
            "1.000000" : 151,
            "5.000000" : 157,
            "10.000000" : 165,
            "20.000000" : 173,
            "30.000000" : 183,
            "40.000000" : 193,
            "50.000000" : 203,
            "60.000000" : 213,
            "70.000000" : 225,
            "80.000000" : 237,
            "90.000000" : 253,
            "95.000000" : 270,
            "99.000000" : 302,
            "99.500000" : 314,
            "99.900000" : 338,
            "99.950000" : 350,
            "99.990000" : 378,
            "0.00" : 0,
            "0.00" : 0,
            "0.00" : 0
          },
          "bins" : {
            "0" : 0,
            "1" : 0,
            "2" : 0,
            "3" : 0,
            "4" : 0,
            "5" : 0,
            "6" : 0,
            "7" : 0,
            "8" : 0,
            "9" : 0,
            "10" : 0,
            "11" : 0,
            "12" : 0,
            "13" : 0,
            "14" : 0,
            "15" : 0,
            "16" : 0,
.
.
<省略>
.
.
            "1200" : 0,
            "1201" : 0,
            "1202" : 0,
            "1203" : 0,
            "1204" : 0,
            "1205" : 0,
            "1206" : 0,
            "1207" : 0,
            "1208" : 0,
            "1209" : 0,
            "1210" : 0,
            "1211" : 0,
            "1212" : 0,
            "1213" : 0,
            "1214" : 0,
            "1215" : 0,
            "FIO_IO_U_PLAT_BITS" : 6,
            "FIO_IO_U_PLAT_VAL" : 64,
            "FIO_IO_U_PLAT_NR" : 1216
          }
        },
        "lat" : {
          "min" : 0,
          "max" : 0,
          "mean" : 0.000000,
          "stddev" : 0.000000
        },
        "bw_min" : 0,
        "bw_max" : 0,
        "bw_agg" : 0.000000,
        "bw_mean" : 0.000000,
        "bw_dev" : 0.000000
      },
      "usr_cpu" : 2.025000,
      "sys_cpu" : 6.760000,
      "ctx" : 89375,
      "majf" : 0,
      "minf" : 143,
      "iodepth_level" : {
        "1" : 100.000000,
        "2" : 0.000000,
        "4" : 0.000000,
        "8" : 0.000000,
        "16" : 0.000000,
        "32" : 0.000000,
        ">=64" : 0.000000
      },
      "latency_us" : {
        "2" : 0.000000,
        "4" : 0.000000,
        "10" : 0.000000,
        "20" : 0.000000,
        "50" : 0.000000,
        "100" : 0.000000,
        "250" : 85.368805,
        "500" : 14.631199,
        "750" : 0.000000,
        "1000" : 0.000000
      },
      "latency_ms" : {
        "2" : 0.000000,
        "4" : 0.000000,
        "10" : 0.000000,
        "20" : 0.000000,
        "50" : 0.000000,
        "100" : 0.000000,
        "250" : 0.000000,
        "500" : 0.000000,
        "750" : 0.000000,
        "1000" : 0.000000,
        "2000" : 0.000000,
        ">=2000" : 0.000000
      },
      "latency_depth" : 1,
      "latency_target" : 0,
      "latency_percentile" : 100.000000,
      "latency_window" : 0
    }
  ],
  "disk_util" : [
    {
      "name" : "sda",
      "read_ios" : 87589,
      "write_ios" : 0,
      "read_merges" : 0,
      "write_merges" : 0,
      "read_ticks" : 18097,
      "write_ticks" : 0,
      "in_queue" : 18053,
      "util" : 98.038826
    }
  ]
}

まとめ

  • とりたい値が限定的であれば出力指定がよい
  • jsonを理解するパーサを用いるのであればjsonオプションを用いることで解析がやりやすくなる