我们将要执行一个随机读测试,我们将会尝试读取一个随机的 2GB 文件。
-
sudo fio --name=randread --ioengine=libaio --iodepth=16 --rw=randread --bs=4k --direct=0 --size=512M --numjobs=4 --runtime=240 --group_reporting
你应该会看到下面这样的输出:
... fio-2.2.10 Starting 4 processes randread: Laying out IO file(s) (1 file(s) / 512MB) randread: Laying out IO file(s) (1 file(s) / 512MB) randread: Laying out IO file(s) (1 file(s) / 512MB) randread: Laying out IO file(s) (1 file(s) / 512MB) Jobs: 4 (f=4): [r(4)] [100.0% done] [71800KB/0KB/0KB /s] [17.1K/0/0 iops] [eta 00m:00s] randread: (groupid=0, jobs=4): err= 0: pid=7586: Sat Aug 5 13:30:52 2017 read : io=2048.0MB, bw=80719KB/s, iops=20179, runt= 25981msec slat (usec): min=72, max=10008, avg=195.79, stdev=94.72 clat (usec): min=2, max=28811, avg=2971.96, stdev=760.33 lat (usec): min=185, max=29080, avg=3167.96, stdev=798.91 clat percentiles (usec): | 1.00th=[ 2192], 5.00th=[ 2448], 10.00th=[ 2576], 20.00th=[ 2736], | 30.00th=[ 2800], 40.00th=[ 2832], 50.00th=[ 2928], 60.00th=[ 3024], | 70.00th=[ 3120], 80.00th=[ 3184], 90.00th=[ 3248], 95.00th=[ 3312], | 99.00th=[ 3536], 99.50th=[ 6304], 99.90th=[15168], 99.95th=[18816], | 99.99th=[22912] bw (KB /s): min=17360, max=25144, per=25.05%, avg=20216.90, stdev=1605.65 lat (usec) : 4=0.01%, 10=0.01%, 250=0.01%, 500=0.01%, 750=0.01% lat (usec) : 1000=0.01% lat (msec) : 2=0.01%, 4=99.27%, 10=0.44%, 20=0.24%, 50=0.04% cpu : usr=1.35%, sys=5.18%, ctx=524309, majf=0, minf=98 IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=100.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.1%, 32=0.0%, 64=0.0%, >=64=0.0% issued : total=r=524288/w=0/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=16 -
Run status group 0 (all jobs): READ: io=2048.0MB, aggrb=80718KB/s, minb=80718KB/s, maxb=80718KB/s, mint=25981msec, maxt=25981msec -
Disk stats (read/write): sda: ios=521587/871, merge=0/1142, ticks=96664/612, in_queue=97284, util=99.85%
最后,我们想要展示一个简单的随机读-写测试来看一看 Fio 返回的输出类型。
读写性能测试
下述命令将会测试 USB Pen 驱动器 (/dev/sdc1 ) 的随机读写性能:
sudo fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=random_read_write.fio --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75
(编辑:ASP站长网)
|