新宿区で働くプロジェクトマネージャーのブログ

新宿区で働くプロジェクトマネージャーのブログ

AmazonWebService実践入門を読んで実践する「その1:I/Oの高速化」

AmazonWebService実践入門の本にあるI/O高速化の方法をベンチマークを使って試してみる。

方法:I/Oが遅い選択肢から順に早くさせていく。

本で紹介されている高速化の方法

  1. EC2のストレージタイプの選択
  2. EC2のボリュームタイプの選択
  3. EBS最適化オプションの選択
  4. RAID0によるスクレイピング
  5. ボリュームの暖機

まずは、fioを試しに使ってみる

ベンチマークコマンドをインスト―ル。

# rootになる
sudo su

# yumのアップデートする
yum clean all
yum -y update

# fioのインストール
yum install libaio-devel
wget http://pkgs.repoforge.org/fio/fio-2.0.14-1.el5.rf.x86_64.rpm
rpm -Uvh fio-2.0.14-1.el5.rf.x86_64.rpm
rpm -qa | grep fio

# fioインストール確認
which fio

fioの実行結果

[root@ip-172-31-26-155 ec2-user]# fio ./fileio_bench/random-read.fio
random-read: (g=0): rw=randread, bs=4K-4K/4K-4K/4K-4K, ioengine=sync, iodepth=1
fio-2.0.14
Starting 1 process
random-read: Laying out IO file(s) (1 file(s) / 100MB)

random-read: (groupid=0, jobs=1): err= 0: pid=7160: Thu Feb 11 16:10:52 2016
  read : io=102400KB, bw=2173.1MB/s, iops=556521 , runt=    46msec
    clat (usec): min=0 , max=24 , avg= 1.09, stdev= 0.77
     lat (usec): min=0 , max=24 , avg= 1.21, stdev= 0.79
    clat percentiles (usec):
     |  1.00th=[    0],  5.00th=[    0], 10.00th=[    1], 20.00th=[    1],
     | 30.00th=[    1], 40.00th=[    1], 50.00th=[    1], 60.00th=[    1],
     | 70.00th=[    1], 80.00th=[    1], 90.00th=[    2], 95.00th=[    2],
     | 99.00th=[    3], 99.50th=[    3], 99.90th=[   13], 99.95th=[   14],
     | 99.99th=[   21]
    lat (usec) : 2=88.38%, 4=11.12%, 10=0.34%, 20=0.14%, 50=0.02%
  cpu          : usr=17.78%, sys=71.11%, ctx=7, majf=0, minf=4
  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=25600/w=0/d=0, short=r=0/w=0/d=0

Run status group 0 (all jobs):
   READ: io=102400KB, aggrb=2173.1MB/s, minb=2173.1MB/s, maxb=2173.1MB/s, mint=46msec, maxt=46msec

Disk stats (read/write):
  xvda: ios=0/0, merge=0/0, ticks=0/0, in_queue=0, util=0.00%
[root@ip-172-31-26-155 ec2-user]#

おーいろいろ結果が出てるがさっぱり意味がわからん。 fioコマンドのことを学ばねば。。。 ということで↓でまずはfioコマンドをお勉強。

tasuku.hatenablog.jp