端くれプログラマの備忘録 Unix [Unix] ioping – ディスクI/Oのレイテンシを測定する

[Unix] ioping – ディスクI/Oのレイテンシを測定する

レイテンシとは (latency): – IT用語辞典バイナリ
http://www.sophia-it.com/content/%E3%83%AC%E3%82%A4%E3%83%86%E3%83%B3%E3%82%B7

レイテンシとは、データの転送要求などのリクエストを発してから、リクエストの結果が返ってくるまでにかかる遅延時間のことである。

インストール

$ wget https://ioping.googlecode.com/files/ioping-0.8.tar.gz
$ tar zxvf ioping-0.8.tar.gz
$ cd ioping-0.8
$ make
$ sudo make install
$

使い方

Usage: ioping [-LABCDWRq] [-c count] [-w deadline] [-pP period] [-i interval]
               [-s size] [-S wsize] [-o offset] directory|file|device
        ioping -h | -v

      -c <count>      stop after <count> requests
      -w <deadline>   stop after <deadline>
      -p <period>     print raw statistics for every <period> requests
      -P <period>     print raw statistics for every <period> in time
      -i <interval>   interval between requests (1s)
      -s <size>       request size (4k)
      -S <wsize>      working set size (1m)
      -o <offset>     working set offset (0)
      -k              keep and reuse temporary working file
      -L              use sequential operations (includes -s 256k)
      -A              use asynchronous I/O
      -C              use cached I/O
      -D              use direct I/O
      -W              use write I/O *DANGEROUS*
      -R              seek rate test (same as -q -i 0 -w 3 -S 64m)
      -B              print final statistics in raw format
      -q              suppress human-readable output
      -h              display this message and exit
      -v              display version and exit

実行例

$ ioping .
4.0 KiB from . (ext4 /dev/mapper/VolGroup-lv_root): request=1 time=6.8 ms
4.0 KiB from . (ext4 /dev/mapper/VolGroup-lv_root): request=2 time=256 us
4.0 KiB from . (ext4 /dev/mapper/VolGroup-lv_root): request=3 time=420 us
4.0 KiB from . (ext4 /dev/mapper/VolGroup-lv_root): request=4 time=227 us
4.0 KiB from . (ext4 /dev/mapper/VolGroup-lv_root): request=5 time=299 us
4.0 KiB from . (ext4 /dev/mapper/VolGroup-lv_root): request=6 time=353 us
4.0 KiB from . (ext4 /dev/mapper/VolGroup-lv_root): request=7 time=362 us
4.0 KiB from . (ext4 /dev/mapper/VolGroup-lv_root): request=8 time=265 us
^C
--- . (ext4 /dev/mapper/VolGroup-lv_root) ioping statistics ---
8 requests completed in 7.8 s, 886 iops, 3.5 MiB/s
min/avg/max/mdev = 227 us / 1.1 ms / 6.8 ms / 2.2 ms
$ ioping -R -s 4k .
--- . (ext4 /dev/mapper/VolGroup-lv_root) ioping statistics ---
24.7 k requests completed in 3.0 s, 8.4 k iops, 32.7 MiB/s
min/avg/max/mdev = 60 us / 119 us / 7.5 ms / 74 us
$ ioping -R -s 256k .
--- . (ext4 /dev/mapper/VolGroup-lv_root) ioping statistics ---
7.9 k requests completed in 3.0 s, 2.8 k iops, 696.7 MiB/s
min/avg/max/mdev = 230 us / 358 us / 8.0 ms / 98 us
$

参考サイト

ioping – simple disk I/0 latency measuring tool – Google Project Hosting
https://code.google.com/p/ioping/

ioping で I/O レイテンシーを計ってみた 08th SE’s Blog
http://08thse.blog87.fc2.com/blog-entry-350.html