android存储读写测试工具-fio

一.工具下载并编译

1.wget http://brick.kernel.dk/snaps/fio-2.2.5.tar.gz

2.tar -zxvf fio-2.2.5.tar.gz

3.cd fio-2.2.5

4.因为我们要在android中运行,所以我们需要安装交叉编译工具

sudo apt-get install gcc-arm-linux-gnueabihf

5.编译代码,指定arm运行平台,编译工具为arm-linux-gnueabihf-gcc,并且需要静态编译

./configure --cpu=arm --cc=arm-linux-gnueabihf-gcc --build-static --disable-shm

make

6.编译完成后会生成fio可执行程序我们把它push到手机中

adb push fio /system/bin/

 

二.测试命令

随机读

fio -filename=/data/test_rand -direct=1 -iodepth 1 -thread -rw=randread -ioengine=psync -bs=1M -size=1G -numjobs=5 -group_reporting -name=mytest

随机写

fio -filename=/data/test_rand -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=1M -size=1G -numjobs=5 -group_reporting -name=mytest

顺序写

fio -filename=/data/test_ordwrite -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=1M -size=1G -numjobs=5 -group_reporting -name=mytest

顺序读

fio -filename=/data/test_ordread -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=1M -size=1G -numjobs=5 -group_reporting -name=mytest

 

三.日志解析

fio: terminating on signal 2
mytest: (groupid=0, jobs=10): err= 0: pid=11806: Mon Oct 19 08:44:24 2020
  read : io=127488KB, bw=154157KB/s, iops=9634, runt=   827msec
    clat (usec): min=237, max=18944, avg=1021.95, stdev=1466.30
     lat (usec): min=237, max=18945, avg=1022.66, stdev=1466.33
    clat percentiles (usec):
     |  1.00th=[  298],  5.00th=[  350], 10.00th=[  390], 20.00th=[  498],
     | 30.00th=[  596], 40.00th=[  660], 50.00th=[  708], 60.00th=[  756],
     | 70.00th=[  804], 80.00th=[  884], 90.00th=[ 1384], 95.00th=[ 2480],
     | 99.00th=[ 9536], 99.50th=[10688], 99.90th=[11840], 99.95th=[11968],
     | 99.99th=[19072]
    bw (KB  /s): min=14501, max=17088, per=10.21%, avg=15735.10, stdev=783.17
    lat (usec) : 250=0.04%, 500=20.17%, 750=38.94%, 1000=27.16%
    lat (msec) : 2=5.52%, 4=5.10%, 10=2.27%, 20=0.80%
  cpu          : usr=1.00%, sys=17.40%, ctx=9100, majf=0, minf=40
  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=7968/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=1

Run status group 0 (all jobs):
   READ: io=127488KB, aggrb=154157KB/s, minb=154157KB/s, maxb=154157KB/s, mint=827msec, maxt=827msec

Disk stats (read/write):
    dm-0: ios=7705/188, merge=0/0, ticks=6370/35190, in_queue=50050, util=92.82%, aggrios=7968/290, aggrmerge=0/2, aggrticks=6360/73220, aggrin_queue=95720, aggrutil=91.97%
  sda: ios=7968/290, merge=0/2, ticks=6360/73220, in_queue=95720, util=91.97%

本次度平均速度为154157KB/s,耗时为827msec

四.配合脚本做性能测试

五.问题汇总

运行报错1:

xxxx:/ # fio -filename=/tmp/test_randread -direct=1 -iodepth 1 -thread -rw=randread -ioengine=psync -bs=16k -size=30G -numjobs=10 -runtime=600 -group_reporting -name=mytest

shmget: Function not implemented

error: failed to setup shm segment

指的编译环境时需要加上:--disable-shm

./configure --cpu=arm --cc=arm-linux-gnueabihf-gcc --build-static --disable-shm

 

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
fio是一个基于命令行的灵活的I/O性能测试工具,可以用来测试各种存储设备的读写性能,包括NAND闪存。使用fio进行NAND闪存的读写速度测试可以按照以下步骤进行: 1. 安装fio工具:在Linux系统中,可以使用包管理器来安装fio工具。例如,在Ubuntu系统中,可以使用以下命令来安装fio工具: ``` sudo apt-get install fio ``` 2. 编写fio测试脚本:可以使用文本编辑器编写fio测试脚本。以下是一个简单的fio测试脚本示例: ``` [global] ioengine=libaio direct=1 bs=4k size=512M numjobs=1 runtime=60 [random-read] rw=randread stonewall filename=/dev/nand ``` 该测试脚本指定了使用libaio引擎、直接I/O、块大小为4KB、测试文件大小为512MB、测试时间为60秒、测试随机读取操作,并将测试文件指定为NAND闪存设备。 3. 运行fio测试脚本:可以使用以下命令来运行fio测试脚本: ``` fio test.fio ``` 其中,test.fiofio测试脚本的文件名。 4. 分析测试结果:fio测试脚本运行完成后,会自动生成测试结果报告。可以通过分析测试结果来评估NAND闪存的读写速度和性能。 需要注意的是,fio测试脚本需要根据具体的测试需求进行调整。例如,可以改变I/O引擎、块大小、测试文件大小、测试时间等参数来进行不同类型的测试。通过使用fio工具进行NAND闪存的读写速度测试,可以得到较为准确的测试结果,并且可以根据具体的测试需求进行灵活的调整。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值