簡(jiǎn)介
Fio是一個(gè)基于GPLV2授權(quán)的開源I/O 壓力測(cè)試 工具,主要用來測(cè)試磁盤IO性能,也可用于測(cè)試CPU,NIC的IO性能。
配置流程
本文選用華為鯤鵬云服務(wù)ECS KC1實(shí)例做測(cè)試,KC1實(shí)例的處理器為兼容ARMv8指令集的鯤鵬920。
1.選擇操作環(huán)境
本文選用華為鯤鵬云服務(wù)ECS KC1實(shí)例做測(cè)試
2.獲取源代碼
https://github.com/axboe/fio/releases提供Fio各版本的源碼壓縮包,可以直接下載。
3. 編譯源代碼
本文以“fio-2.1.10”版本為例,下載源碼,并編譯安裝。
1)下載Fio源碼。
wget https://github.com/axboe/fio/archive/fio-2.1.10.tar.gz
2)解壓Fio源碼。
tar -zxvf fio-2.1.10.tar.gz
3)編譯并安裝Fio。
cd fio-fio-2.1.10
make
make install
4)檢查安裝的Fio版本號(hào)。
fio --version
5)回顯信息如下,則Fio安裝成功。
fio-2.1.10
4.測(cè)試已完成編譯的軟件
以讀帶寬為例,測(cè)試Fio是否可以正常使用。
執(zhí)行以下命令:
fio --filename=/tmp/test_read -direct=1 -rw=read -bs=1m -size=1G -numjobs=4 -runtime=10 -group_reporting -name=mytest
回顯信息如下,若能正常顯示磁盤讀速率,則表示Fio可正常使用。
mytest: (g=0): rw=read, bs=1M-1M/1M-1M/1M-1M, ioengine=sync, iodepth=1
...
fio-2.1.10
Starting 4 processes
mytest: Laying out IO file(s) (1 file(s) / 1024MB)
Jobs: 4 (f=4): [RRRR] [100.0% done] [150.0MB/0KB/0KB /s] [150/0/0 iops] [eta 00m:00s]
mytest: (groupid=0, jobs=4): err= 0: pid=20659: Sat Jul 6 18:00:27 2019
read : io=1587.0MB, bw=153195KB/s, iops=149, runt= 10608msec
clat (msec): min=1, max=869, avg=26.72, stdev=133.87
lat (msec): min=1, max=869, avg=26.72, stdev=133.87
clat percentiles (msec):
| 1.00th=[ 3], 5.00th=[ 3], 10.00th=[ 3], 20.00th=[ 4],
| 30.00th=[ 4], 40.00th=[ 4], 50.00th=[ 5], 60.00th=[ 5],
| 70.00th=[ 5], 80.00th=[ 6], 90.00th=[ 7], 95.00th=[ 8],
| 99.00th=[ 848], 99.50th=[ 857], 99.90th=[ 865], 99.95th=[ 873],
| 99.99th=[ 873]
bw (KB /s): min=36283, max=40487, per=25.04%, avg=38354.52, stdev=879.60
lat (msec) : 2=0.57%, 4=47.20%, 10=48.20%, 20=1.13%, 50=0.13%
lat (msec) : 500=0.25%, 1000=2.52%
cpu : usr=0.05%, sys=0.15%, ctx=1599, majf=0, minf=84
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=1587/w=0/d=0, short=r=0/w=0/d=0
latency : target=0, window=0, percentile=100.00%, depth=1
Run status group 0 (all jobs):
READ: io=1587.0MB, aggrb=153194KB/s, minb=153194KB/s, maxb=153194KB/s, mint=10608msec, maxt=10608msec
Disk stats (read/write):
vda: ios=1602/4, merge=31/7, ticks=42550/0, in_queue=12010, util=34.53%