Help us understand the problem. What is going on with this article?

ディスクのベンチマークを見やすいかんじにしたい

More than 3 years have passed since last update.

ディスクのベンチマークをとるときはfioが便利。よくある使い方だとサマリーだけ確認する方法があるけども、ディスク全体にわたってベンチマークを取りたいときにちょっと不便だし、そもそも表示がよくわからない。もうすこしグラフィカルにわかりやすくしたい。

fiovisualizerを使う

fiovisualizerはIntelが作ったツールでXで動くfioのフロントエンドだ。これを使うと、こんなかんじでかなりわかりやすく表示してくれる。

Screen Shot 2015-12-17 at 12.19.48 PM.png

グラフはPNG、CSV、MAT形式で保存できるので良い感じに加工することも可能だ。

fioの出力をパースする

fiovisualizerを使うとだいたい良い感じにできて、これを使ってベンチマークを集めていたのだが、いかんせんVNC経由でXを操作するのが面倒くさい。そのうち耐えきれなくなるので自動化することになる。fiovisualizer自体はfioの出力をパースしているだけなので、自前でパースできるはずだ。

fioのステータスを1秒ごとに出力させるには--status-intervalを指定すれば良い。

w="randread_32K_qd32"

fio --output result/${w}.log --status-interval=1 ${w}.ini

これで1秒ごとに結果を出力してくれるようになるが、標準形式ではパースしづらいし、読みやすいとも言えないので結構つらい。

JSON形式で出力させる

fio --output result/auto/${w}.log --output-format=json --status-interval=1 ${w}.ini

--output-formatオプションでjsonを指定するとJSON形式で出力してくれる。が、なぜかprettifyされたJSONなので改行で区切れなくて扱いづらかった。標準形式よりは読みやすいし、LLを使ってパースするならよさそう。

Terse形式で出力させる

fio --output result/auto/${w}.log --output-format=terse --status-interval=1 ${w}.ini

ということでterseとよばれる独自形式を使うことになる。これはセミコロンで区切られたCSVみたいな形式でfioのmanにフォーマットが説明されている。まだ扱いやすそうだし、ひとまずread/writeのIOPSとBWだけわかれば目的を達成できそう。セミコロンで区切ると次の様になっている。

output version                                  : 3
fio version                                     : fio-2.1.11
jobname                                         : job1
groupid                                         : 0
error                                           : 0
read total IO (KB)                              : 0
read bandwidth (KB/s)                           : 0
read IOPS                                       : 0
read runtime (ms)                               : 0
read submission latency (min)                   : 0
read submission latency (max)                   : 0
read submission latency (mean)                  : 0.000000
read submission latency (stddev)                : 0.000000
read completion latency (min)                   : 0
read completion latency (max)                   : 0
read completion latency (mean)                  : 0.000000
read completion latency (stddev)                : 0.000000
read completion latency percentiles[0]          : 1.000000%=0
read completion latency percentiles[ 1]         : 5.000000%=0
read completion latency percentiles[ 2]         : 10.000000%=0
read completion latency percentiles[ 3]         : 20.000000%=0
read completion latency percentiles[ 4]         : 30.000000%=0
read completion latency percentiles[ 5]         : 40.000000%=0
read completion latency percentiles[ 6]         : 50.000000%=0
read completion latency percentiles[ 7]         : 60.000000%=0
read completion latency percentiles[ 8]         : 70.000000%=0
read completion latency percentilse[09]         : 80.000000%=0
read completion latency percentilse[10]         : 90.000000%=0
read completion latency percentilse[11]         : 95.000000%=0
read completion latency percentilse[12]         : 99.000000%=0
read completion latency percentilse[13]         : 99.500000%=0
read completion latency percentilse[14]         : 99.900000%=0
read completion latency percentilse[15]         : 99.950000%=0
read completion latency percentilse[16]         : 99.990000%=0
read completion latency percentilse[17]         : 0%=0
read completion latency percentilse[18]         : 0%=0
read completion latency percentilse[29]         : 0%=0
read total latency (min)                        : 0
read total latency (max)                        : 0
read total latency (mean)                       : 0.000000
read total latency (stddev)                     : 0.000000
read bandwidth (min)                            : 0
read bandwidth (max)                            : 0
read bandwidth (aggregate percentage of total)  : 0.000000%
read bandwidth (meean)                          : 0.000000
read bandwidth (stddev)                         : 0.000000
write total IO (KB)                             : 4949504
write bandwidth (KB/s)                          : 498138
write IOPS                                      : 976
write runtime (ms)                              : 9936
write submission latency (min)                  : 31
write submission latency (max)                  : 147
write submission latency (mean)                 : 59.602227
write submission latency (stddev)               : 5.302787
write completion latency (min)                  : 2516
write completion latency (max)                  : 34132
write completion latency (mean)                 : 32616.530823
write completion latency (stddev)               : 1105.442177
write completion latency percentiles[0]         : 1.000000%=32128
write completion latency percentiles[ 1]        : 5.000000%=32384
write completion latency percentiles[ 2]        : 10.000000%=32384
write completion latency percentiles[ 3]        : 20.000000%=32384
write completion latency percentiles[ 4]        : 30.000000%=32384
write completion latency percentiles[ 5]        : 40.000000%=32384
write completion latency percentiles[ 6]        : 50.000000%=32384
write completion latency percentiles[ 7]        : 60.000000%=32384
write completion latency percentiles[ 8]        : 70.000000%=32384
write completion latency percentilse[09]        : 80.000000%=33536
write completion latency percentilse[10]        : 90.000000%=33536
write completion latency percentilse[11]        : 95.000000%=33536
write completion latency percentilse[12]        : 99.000000%=34048
write completion latency percentilse[13]        : 99.500000%=34048
write completion latency percentilse[14]        : 99.900000%=34048
write completion latency percentilse[15]        : 99.950000%=34048
write completion latency percentilse[16]        : 99.990000%=34048
write completion latency percentilse[17]        : 0%=0
write completion latency percentilse[18]        : 0%=0
write completion latency percentilse[29]        : 0%=0
write total latency (min)                       : 2611
write total latency (max)                       : 34189
write total latency (mean)                      : 32676.746380
write total latency (stddev)                    : 1106.357541
write bandwidth (min)                           : 496640
write bandwidth (max)                           : 499736
write bandwidth (aggregate percentage of total) : 100.000000%
write bandwidth (meean)                         : 498635.368421
write bandwidth (stddev)                        : 870.139977
cpu (user)                                      : 16.626409%
cpu (system)                                    : 5.998390%
cpu (context switches)                          : 9678
cpu (major page faults)                         : 0
cpu (minor page faults)                         : 9
IO depth (<=1)                                  : 0.1%
IO depth (2)                                    : 0.1%
IO depth (4)                                    : 0.1%
IO depth (8)                                    : 0.1%
IO depth (16)                                   : 0.2%
IO depth (32)                                   : 99.7%
IO depth (>=64)                                 : 0.0%
IO latency (<= 2us)                             : 0.00%
IO latency (4us)                                : 0.00%
IO latency (10us)                               : 0.00%
IO latency (20us)                               : 0.00%
IO latency (50us)                               : 0.00%
IO latency (100us)                              : 0.00%
IO latency (250us)                              : 0.00%
IO latency (500us)                              : 0.00%
IO latency (750us)                              : 0.00%
IO latency (1000us)                             : 0.00%
IO latency (<=2ms)                              : 0.00%
IO latency (4ms)                                : 0.02%
IO latency (10ms)                               : 0.05%
IO latency (20ms)                               : 0.11%
IO latency (50ms)                               : 99.49%
IO latency (100ms)                              : 0.00%
IO latency (250ms)                              : 0.00%
IO latency (500ms)                              : 0.00%
IO latency (750ms)                              : 0.00%
IO latency (1000ms)                             : 0.00%
IO latency (2000ms)                             : 0.00%
IO latency (>=2000ms)                           : 0.00%

ここまでできればawkとかで適当に扱えると思う。これでGoogle Spreadsheetで可視化できるようになった。

Screen Shot 2015-12-17 at 12.52.53 PM.png

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away