fio 工具探究 1

基本语法

./fio -filename=/mnt/sdcard/fiofile -direct=1 -rw=read -bs=8k -siz
e=1G -numjobs=8 -runtime=10  -group_reporting -name=fio_test

--help

/mnt/sdcard # ./fio --help
fio-2.20
./fio [options] [job options] <job file(s)>
  --debug=options   Enable debug logging. May be one/more of:
            process,file,io,mem,blktrace,verify,random,parse,
            diskutil,job,mutex,profile,time,net,rate,compress,
            steadystate,helperthread
  --parse-only      Parse options only, don't start any IO
  --output      Write output to file
  --bandwidth-log   Generate aggregate bandwidth logs
  --minimal     Minimal (terse) output
  --output-format=type  Output format (terse,json,json+,normal)
  --terse-version=type  Set terse version output format (default 3, or 2 or 4)
  --version     Print version info and exit
  --help        Print this page
  --cpuclock-test   Perform test/validation of CPU clock
  --crctest=type    Test speed of checksum functions
  --cmdhelp=cmd     Print command help, "all" for all of them
  --enghelp=engine  Print ioengine help, or list available ioengines
  --enghelp=engine,cmd  Print help for an ioengine cmd
  --showcmd     Turn a job file into command line options
  --eta=when        When ETA estimate should be printed
                    May be "always", "never" or "auto"
  --eta-newline=time    Force a new line for every 'time' period passed
  --status-interval=t   Force full status dump every 't' period passed
  --readonly        Turn on safety read-only checks, preventing writes
  --section=name    Only run specified section in job file, multiple sections can be specified
  --alloc-size=kb   Set smalloc pool to this size in kb (def 16384)
  --warnings-fatal  Fio parser warnings are fatal
  --max-jobs=nr     Maximum number of threads/processes to support
  --server=args     Start a backend fio server
  --daemonize=pidfile   Background fio server, write pid to file
  --client=hostname Talk to remote backend(s) fio server at hostname
  --remote-config=file  Tell fio server to load this local job file
  --idle-prof=option    Report cpu idleness on a system or percpu basis
            (option=system,percpu) or run unit work
            calibration only (option=calibrate)
  --inflate-log=log Inflate and output compressed log
  --trigger-file=file   Execute trigger cmd when file exists
  --trigger-timeout=t   Execute trigger af this time
  --trigger=cmd     Set this command as local trigger
  --trigger-remote=cmd  Set this command as remote trigger
  --aux-path=path   Use this path for fio state generated files

Fio was written by Jens Axboe <jens.axboe@oracle.com>
                   Jens Axboe <jaxboe@fusionio.com>
                   Jens Axboe <axboe@fb.com>

基本每太看懂 不过按照语法还是可以用的
基本语法中,-rw=read/write/randread/randwrite 可以简单测试读写性能。

结果

/mnt/sdcard # ./fio -filename=/mnt/sdcard/fiofile -direct=1 -rw=read -bs=8k -siz
e=1G -numjobs=8 -runtime=10  -group_reporting -name=fio_test
fio_test: (g=0): rw=read, bs=(R) 8192B-8192B, (W) 8192B-8192B, (T) 8192B-8192B, ioengine=psync, iodepth=1
...
fio-2.20
Starting 8 processes
Jobs: 8 (f=8): [R(8)][100.0%][r=14.8MiB/s,w=0KiB/s][r=1899,w=0 IOPS][eta 00m:00s]
fio_test: (groupid=0, jobs=8): err= 0: pid=4542: Wed Aug 12 17:53:16 2020
   read: IOPS=2177, BW=17.0MiB/s (17.8MB/s)(170MiB/10005msec)
    clat (usec): min=614, max=1000.1k, avg=3640.26, stdev=36487.91
     lat (usec): min=620, max=1000.1k, avg=3643.89, stdev=36488.06
    clat percentiles (usec):
     |  1.00th=[ 1032],  5.00th=[ 1080], 10.00th=[ 1096], 20.00th=[ 1144],
     | 30.00th=[ 1176], 40.00th=[ 1208], 50.00th=[ 1272], 60.00th=[ 1352],
     | 70.00th=[ 1432], 80.00th=[ 1512], 90.00th=[ 1592], 95.00th=[ 1656],
     | 99.00th=[ 9792], 99.50th=[74240], 99.90th=[659456], 99.95th=[897024],
     | 99.99th=[995328]
   bw (  KiB/s): min=   16, max= 6435, per=0.01%, avg=2483.22, stdev=2170.08
    lat (usec) : 750=0.01%, 1000=0.33%
    lat (msec) : 2=97.77%, 4=0.71%, 10=0.20%, 20=0.36%, 50=0.09%
    lat (msec) : 100=0.10%, 250=0.08%, 500=0.16%, 750=0.12%, 1000=0.06%
    lat (msec) : 2000=0.01%
  cpu          : usr=1.43%, sys=3.70%, ctx=21914, majf=0, minf=151
  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 rwt: total=21785,0,0, short=0,0,0, dropped=0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
   READ: bw=17.0MiB/s (17.8MB/s), 17.0MiB/s-17.0MiB/s (17.8MB/s-17.8MB/s), io=170MiB (178MB), run=10005-10005msec

Disk stats (read/write):
  mmcblk1: ios=21118/5, merge=0/1, ticks=57616/3072, in_queue=61611, util=98.98%

一个简单的-rw=read的测试结果。

/mnt/sdcard # ./fio -filename=/mnt/sdcard/fiofile -direct=1 -rw=write -bs=8k -si
ze=1G -numjobs=8 -runtime=10  -group_reporting -name=fio_test
fio_test: (g=0): rw=write, bs=(R) 8192B-8192B, (W) 8192B-8192B, (T) 8192B-8192B, ioengine=psync, iodepth=1
...
fio-2.20
Starting 8 processes
Jobs: 8 (f=8): [W(8)][100.0%][r=0KiB/s,w=4472KiB/s][r=0,w=559 IOPS][eta 00m:00s]
fio_test: (groupid=0, jobs=8): err= 0: pid=4678: Wed Aug 12 18:01:38 2020
  write: IOPS=535, BW=4283KiB/s (4386kB/s)(41.9MiB/10016msec)
    clat (msec): min=1, max=371, avg=14.89, stdev=61.66
     lat (msec): min=1, max=371, avg=14.89, stdev=61.66
    clat percentiles (usec):
     |  1.00th=[ 1160],  5.00th=[ 1192], 10.00th=[ 1224], 20.00th=[ 1256],
     | 30.00th=[ 1320], 40.00th=[ 1448], 50.00th=[ 1784], 60.00th=[ 1848],
     | 70.00th=[ 1880], 80.00th=[ 1960], 90.00th=[ 2096], 95.00th=[14912],
     | 99.00th=[329728], 99.50th=[337920], 99.90th=[350208], 99.95th=[362496],
     | 99.99th=[370688]
   bw (  KiB/s): min=  304, max=  919, per=0.01%, avg=538.71, stdev=162.41
    lat (msec) : 2=83.61%, 4=10.16%, 10=0.65%, 20=1.01%, 50=0.19%
    lat (msec) : 100=0.06%, 250=0.19%, 500=4.14%
  cpu          : usr=0.38%, sys=1.71%, ctx=10964, majf=0, minf=155
  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 rwt: total=0,5362,0, short=0,0,0, dropped=0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
  WRITE: bw=4283KiB/s (4386kB/s), 4283KiB/s-4283KiB/s (4386kB/s-4386kB/s), io=41.9MiB (43.9MB), run=10016-10016msec

Disk stats (read/write):
  mmcblk1: ios=0/5264, merge=0/1, ticks=0/8771, in_queue=8744, util=88.05%

个简单的-rw=write的测试结果。

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,921评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 87,635评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,393评论 0 338
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,836评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,833评论 5 368
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,685评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,043评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,694评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 42,671评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,670评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,779评论 1 332
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,424评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,027评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,984评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,214评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,108评论 2 351
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,517评论 2 343