LoginSignup
3
3

More than 5 years have passed since last update.

ベンチマーク fioでストレージの性能評価をためしてみた② ~評価編~

Last updated at Posted at 2018-12-12

でLinuxのディスクIO計測ベンチマークとして有名なfioをインすt-るできましたので、ストレージの性能評価をためしてみようとおもいます。

:heart:関連記事:heart:
ベンチマーク fioでストレージの性能評価をためしてみた① ~fioインストール編~

参考

参考文献はこちらです。
fioを使ってストレージの性能を計測してみた
[Linux] ディスク性能テストにfioを使ってみる
FIOコマンドで利用できるパラメータ
fioを使ったベンチマーク
man fio やっぱりmanですね
fio document

検証内容

  • LinuxVM上にマウントしたSDDに5MBのファイルを読み書きして書き込みしてIO特性をみてみる

検証内容詳細・前提条件

  • 5MBのファイルを5分間ランダムに読み書きし値を計測する
  • ブロックサイズ4KB、jobの数は1つで計測する
  • 読み込み書き込の比率は書き込み80%、読み込み20%

検証環境

今回の検証環境
[OS] CentOS7.5
[対象] /var/dataにマウントした/dev/sdc1 32G

$ cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda2       30929148 2958060  27971088  10% /
devtmpfs         4066508       0   4066508   0% /dev
tmpfs            4078652       0   4078652   0% /dev/shm
tmpfs            4078652   25680   4052972   1% /run
tmpfs            4078652       0   4078652   0% /sys/fs/cgroup
/dev/sda1         508580   82188    426392  17% /boot
/dev/sdb1       16381756   45084  15481484   1% /mnt/resource
tmpfs             815732       0    815732   0% /run/user/1000
/dev/sdc1        30929148 2958060  27971088  10% /var/data

$ free -m
              total        used        free      shared  buff/cache   available
Mem:           7966         306        5515          25        2144        7224
Swap:             0           0           0

## fioベンチマークオプションの設定
fioの計測のための設定オプションはたくさんあるのですが、今回利用したコマンド、オプションは下記です。

その他レイテンシーの状況を保存するオプション(write_lat_log)などがあります。
詳細は[こちらのページ](https://fio.readthedocs.io/en/latest/fio_doc.html)の1.12. Job file parametersに記載されていますので測定方法に合わせて変更してください。


```fio -filename=/var/data/fuse/fio -direct=0 -rw=randrw -rwmixread=20 -bs=4k -filesize=5M -numjobs=1 -runtime=300 -group_reporting -name=test --ioengine=libaio -t
ime_based```


|オプション名                     |    内容                                                                    |
|:------------------------------|:--------------------------------------------------------------------------------------|
|**-direct=0              ** | direct=1の場合は直接書き込み、0はバッファしての測定です。バッファも含めての試験をしたかったので0に設定しました              |
|**-rw=randrw              **| ランダムの読み書きなのでrandrw、その他にシーケンシャルや読み込みのみ、書き込みのみなどのオプションがあります|
|**-bs=4k                 **| ブロックサイズ。今回はデフォルトで設定しました                           
                             |
|**-filesize=5M           **| I/Oで利用するファイルサイズ今回は5Mで設定しています。                                                                                       |
|**--ioengine=libaio                           **|今回非同期書き込みとなるのでfsyncではなくlibaioを選択しました          |
|**-time_based                **| runtimeの間ずっと実行する設定。I/O全体のサイズを設定することもできるのですが今回は5分間ながして特性をみたいと思ったのでtime_basedにしています|
|**-runtime=300              **|実行時間|
|**- numjobs=1              **|並行処理するジョブの数。多くしすぎるとulimitに引っかかって怒られます。今回は単発で実行して動作をみたかったので1にしています。|
|**-group_reporting               **|複数のjobを実行した場合に結果をまとめる設定。今回は必要なしなオプションです。|



## 実行

実行が開始すると下記のように表示されます。
今回タイムベースなのでeta XXm:XXsに記載の時間が終わるまで待ちます。

$fio -filename=/var/data/fio -direct=0 -rw=randrw -rwmixread=20 -bs=4k -filesize=5M -numjobs=1 -runtime=300 -group_reporting -name=test --ioengine=libaio -t
ime_based
test: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1
fio-3.1
Starting 1 process
Jobs: 1 (f=1)
Jobs: 1 (f=1): [m(1)][9.7%][r=14.4MiB/s,w=57.6MiB/s][r=3688,w=14.7k IOPS][eta 04m:31s]
```

結果

画面表示

実行が完了すると下記のような結果が表示されます。

$ date; sudo fio -filename=/var/data -direct=0 -rw=randrw -rwmixread=20 -bs=4k -filesize=5M -numjobs=1 -runtime=300 -group_reporting -name=test --ioengine=libaio -t
ime_based ;date
Wed Dec 12 02:24:15 UTC 2018
test: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1
fio-3.1
Starting 1 process
test: Laying out IO file (1 file / 5MiB)
fio: native_fallocate call failed: Operation not supported
Jobs: 1 (f=1): [m(1)][100.0%][r=14.9MiB/s,w=58.9MiB/s][r=3806,w=15.1k IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=22333: Wed Dec 12 02:29:17 2018
   read: IOPS=3795, BW=14.8MiB/s (15.5MB/s)(4448MiB/300001msec)
    slat (nsec): min=1800, max=4786.5k, avg=3775.71, stdev=8091.60
    clat (nsec): min=1100, max=2140.2k, avg=1785.89, stdev=3655.80
     lat (usec): min=3, max=4790, avg= 6.49, stdev= 9.23
    clat percentiles (nsec):
     |  1.00th=[ 1208],  5.00th=[ 1304], 10.00th=[ 1304], 20.00th=[ 1400],
     | 30.00th=[ 1400], 40.00th=[ 1496], 50.00th=[ 1496], 60.00th=[ 1608],
     | 70.00th=[ 1608], 80.00th=[ 1608], 90.00th=[ 1704], 95.00th=[ 1800],
     | 99.00th=[17024], 99.50th=[18816], 99.90th=[29056], 99.95th=[41728],
     | 99.99th=[77312]
   bw (  KiB/s): min=13270, max=17857, per=100.00%, avg=15419.33, stdev=774.51, samples=600
   iops        : min= 3317, max= 4464, avg=3854.45, stdev=193.62, samples=600
  write: IOPS=15.2k, BW=59.2MiB/s (62.1MB/s)(17.4GiB/300001msec)
    slat (usec): min=13, max=16955, avg=54.85, stdev=49.80
    clat (nsec): min=1200, max=6330.9k, avg=2366.94, stdev=5245.85
     lat (usec): min=15, max=16959, avg=59.42, stdev=50.37
    clat percentiles (nsec):
     |  1.00th=[ 1400],  5.00th=[ 1496], 10.00th=[ 1608], 20.00th=[ 1608],
     | 30.00th=[ 1704], 40.00th=[ 1800], 50.00th=[ 1800], 60.00th=[ 1896],
     | 70.00th=[ 1896], 80.00th=[ 2008], 90.00th=[ 2192], 95.00th=[ 6176],
     | 99.00th=[18048], 99.50th=[21120], 99.90th=[41728], 99.95th=[55552],
     | 99.99th=[92672]
   bw (  KiB/s): min=53336, max=71504, per=100.00%, avg=61610.90, stdev=2882.08, samples=600
   iops        : min=13334, max=17876, avg=15402.35, stdev=720.51, samples=600
  lat (usec)   : 2=79.03%, 4=16.06%, 10=3.28%, 20=1.13%, 50=0.45%
  lat (usec)   : 100=0.05%, 250=0.01%, 500=0.01%, 750=0.01%, 1000=0.01%
  lat (msec)   : 2=0.01%, 4=0.01%, 10=0.01%
  cpu          : usr=19.06%, sys=44.89%, ctx=4549539, majf=0, minf=26
  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 rwt: total=1138569,4549244,0, short=0,0,0, dropped=0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
   READ: bw=14.8MiB/s (15.5MB/s), 14.8MiB/s-14.8MiB/s (15.5MB/s-15.5MB/s), io=4448MiB (4664MB), run=300001-300001msec
  WRITE: bw=59.2MiB/s (62.1MB/s), 59.2MiB/s-59.2MiB/s (62.1MB/s-62.1MB/s), io=17.4GiB (18.6GB), run=300001-300001msec
Wed Dec 12 02:29:17 UTC 2018

I/O、スループットの確認の仕方

計測結果で今回確認した部分はreadとwriteになります。
それぞれの値は下記に記載します。

途中のlatが3行並んでいる部分はそれぞれの値の出現確立です。
この値をみるとIO全体の処理時間が代替どの程度なのかざっくりとつかめます。

BW 帯域幅、スループット
IOPS IOPS
slat ベンチマークツールがI/O発行後Linuxがコマンド発行までの時間
clat コマンド発行から応答を受け取るまでの時間
lat slatとclatを足した全体のIO処理時間
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3