关于iops的测试

fio 测试

现新项目boss想把MySQL搭建在KVM环境上,现在不清楚innodb_io_capacity 这个参数具体应该写多少,所以做了下关于IO的测试。


fio -filename=/dev/mapper/centos-data -direct=1 -rw=randrw -bs=16k -rwmixread=50 -ioengine=libaio -size=50G -numjobs=32 -runtime=1800 -group_reporting -ioscheduler=deadline -name=randrw-libaio > /tmp/ioreport.txt


[root@ic-mysql-notice-master01 ~]# cat /tmp/ioreport.txt 
randrw-libaio: (g=0): rw=randrw, bs=16K-16K/16K-16K/16K-16K, ioengine=libaio, iodepth=1
...
fio-2.2.8
Starting 32 processes

randrw-libaio: (groupid=0, jobs=32): err= 0: pid=12308: Fri Dec 15 04:40:03 2017
read : io=23166MB, bw=13174KB/s, iops=823, runt=1800592msec
slat (usec): min=3, max=376, avg=20.20, stdev= 9.47
clat (usec): min=38, max=4995.9K, avg=17433.63, stdev=59851.78
lat (usec): min=49, max=4995.1K, avg=17454.51, stdev=59851.83
clat percentiles (usec):
| 1.00th=[ 139], 5.00th=[ 227], 10.00th=[ 1144], 20.00th=[ 4448],
| 30.00th=[ 7712], 40.00th=[10304], 50.00th=[13248], 60.00th=[16192],
| 70.00th=[19840], 80.00th=[24192], 90.00th=[31104], 95.00th=[38144],
| 99.00th=[56576], 99.50th=[74240], 99.90th=[757760], 99.95th=[1449984],
| 99.99th=[2637824]
bw (KB /s): min= 3, max= 1053, per=3.40%, avg=448.12, stdev=146.86
write: io=23102MB, bw=13138KB/s, iops=821, runt=1800592msec
slat (usec): min=4, max=466, avg=23.94, stdev=10.55
clat (usec): min=81, max=4990.3K, avg=21432.31, stdev=65751.84
lat (usec): min=97, max=4990.4K, avg=21456.95, stdev=65751.88
clat percentiles (usec):
| 1.00th=[ 1048], 5.00th=[ 2224], 10.00th=[ 4768], 20.00th=[ 8512],
| 30.00th=[11456], 40.00th=[14144], 50.00th=[17024], 60.00th=[19840],
| 70.00th=[23424], 80.00th=[27776], 90.00th=[34560], 95.00th=[41728],
| 99.00th=[61696], 99.50th=[86528], 99.90th=[880640], 99.95th=[1564672],
| 99.99th=[2899968]
bw (KB /s): min= 3, max= 990, per=3.40%, avg=446.66, stdev=144.31
lat (usec) : 50=0.01%, 100=0.06%, 250=2.89%, 500=0.48%, 750=0.23%
lat (usec) : 1000=1.04%
lat (msec) : 2=4.88%, 4=4.47%, 10=18.08%, 20=33.38%, 50=32.52%
lat (msec) : 100=1.54%, 250=0.19%, 500=0.09%, 750=0.03%, 1000=0.03%
lat (msec) : 2000=0.05%, >=2000=0.04%
cpu : usr=0.06%, sys=0.17%, ctx=2961253, majf=0, minf=951
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=1482608/w=1478504/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=23166MB, aggrb=13174KB/s, minb=13174KB/s, maxb=13174KB/s, mint=1800592msec, maxt=1800592msec
WRITE: io=23102MB, aggrb=13137KB/s, minb=13137KB/s, maxb=13137KB/s, mint=1800592msec, maxt=1800592msec

用的是随机读写模式,32线程 50G文件大小,这里看报告IOPS就是读的823 +写的821 1644么? 如果是 参数文件中innodb_io_capacity 800 innodb_io_capacity_max 1600 这样设置是否合适?
是否还需要对其他模式进行压测?
已邀请:

yejr

赞同来自:

从测试结果来看,最后的设置是可以的。
在运行过程中保持关注,根据iops和%util两个指标判定io负载高低。

要回复问题请先登录注册