filesystem测试工具之filebench
来源:互联网 发布:订酒店哪个软件好 知乎 编辑:程序博客网 时间:2024/06/05 19:31
简介
Filebench 是一款文件系统性能的自动化测试工具,它通过快速模拟真实应用服务器的负载来测试文件系统的性能。它不仅可以仿真文件系统微操作(如 copyfiles, createfiles, randomread, randomwrite ),而且可以仿真复杂的应用程序(如 varmail, fileserver, oltp, dss, webserver, webproxy )。 Filebench 比较适合用来测试文件服务器性能,但同时也是一款负载自动生成工具,也可用于文件系统的性能。
代码
https://github.com/filebench/filebench
安装
1234567891011121314151617181920212223242526272829
# yum install libtool automake# libtoolize# aclocal# autoheader# automake --add-missing# autoconf# yum install gcc flex bison# ./configure# make# make install...----------------------------------------------------------------------▽Libraries have been installed in:/usr/local/lib/filebenchIf you ever happen to want to link against installed librariesin a given directory, LIBDIR, you must either use libtool, andspecify the full pathname of the library, or use the `-LLIBDIR'flag during linking and do at least one of the following:- add LIBDIR to the `LD_LIBRARY_PATH' environment variableduring execution- add LIBDIR to the `LD_RUN_PATH' environment variableduring linking- use the `-Wl,-rpath -Wl,LIBDIR' linker flag- have your system administrator add LIBDIR to `/etc/ld.so.conf'See any operating system documentation about shared libraries formore information, such as the ld(1) and ld.so(8) manual pages.----------------------------------------------------------------------...
运行
在目录 /usr/local/share/filebench/workloads/ 下有很多定义好的workload,我们可以拿来使用
配置里面的 $dir 为测试filesystem的目录,若文件后没有run <secs>
命令,添加:run <secs>
1234567891011
# ls /usr/local/share/filebench/workloads/compflow_demo.f filemicro_rwrite.f fivestreamreaddirect.f openfiles.f singlestreamwrite.fcopyfiles.f filemicro_rwritefsync.f fivestreamread.f randomfileaccess.f tpcso.fcreatefiles.f filemicro_seqread.f fivestreamwritedirect.f randomread.f varmail.fcvar_example.f filemicro_seqwrite.f fivestreamwrite.f randomrw.f videoserver.ffilemicro_create.f filemicro_seqwriterand.f listdirs.f randomwrite.f webproxy.ffilemicro_createfiles.f filemicro_seqwriterandvargam.f makedirs.f ratelimcopyfiles.f webserver.ffilemicro_createrand.f filemicro_seqwriterandvartab.f mongo.f removedirs.ffilemicro_delete.f filemicro_statfile.f netsfs.f singlestreamreaddirect.ffilemicro_rread.f filemicro_writefsync.f networkfs.f singlestreamread.ffilemicro_rwritedsync.f fileserver.f oltp.f singlestreamwritedirect.f
1234567891011121314151617181920
# /usr/local/bin/filebench -f /usr/local/share/filebench/workloads/createfiles.fFilebench Version 1.5-alpha30.000: Allocated 173MB of shared memory0.001: Createfiles Version 3.0 personality successfully loaded0.001: Populating and pre-allocating filesets0.031: bigfileset populated: 50000 files, avg. dir. width = 100, avg. dir. depth = 2.3, 0 leafdirs, 781.250MB total size0.031: Removing bigfileset tree (if exists)0.033: Pre-allocating directories in bigfileset tree0.159: Pre-allocating files in bigfileset tree0.207: Waiting for pre-allocation to finish (in case of a parallel pre-allocation)0.207: Population and pre-allocation of filesets completed0.208: Starting 1 filecreate instances1.210: Running...17.211: Run took 16 seconds...17.211: Per-Operation Breakdownclosefile1 49985ops 3124ops/s 0.0mb/s 0.002ms/op [0.001ms - 0.238ms]writefile1 49985ops 3124ops/s 48.8mb/s 0.020ms/op [0.006ms - 2.307ms]createfile1 50000ops 3125ops/s 0.0mb/s 4.905ms/op [0.147ms - 1267.256ms]17.211: IO Summary: 149970 ops 9372.298 ops/s 0/3124 rd/wr 48.8mb/s 1.643ms/op17.211: Shutting down processes
输出解释:
- flowop name - 支持的flowop有很多
- 所有threads的ops
- 所有threads的ops / run time
- 所有threads的
READ/WRITE
带宽 - 所有threads的每个op的平均latency
- 测试中op的最小和最大latency
IO Summary:
149970 ops
:所有flowop的总和9372.298 ops/s
:所有flowop的总和 / run time0/3124 rd/wr
:所有flowop中READ/WRITE
的ops / run time48.8mb/s
: 所有flowop的IO带宽1.643ms/op
:所有flowop的每个op的平均latency
参考
https://github.com/filebench/filebench/wiki/Collected-metrics
写workload
我们可以自己写workload文件,语法格式可参考:https://github.com/filebench/filebench/wiki/Workload-model-language
以createfiles.f为例,解释里面的含义:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
# cat createfiles.f...// 下面是用户变量定义set $dir=/home/yangguanjun3/mike/tst1set $nfiles=50000set $meandirwidth=100set $meanfilesize=16kset $iosize=1mset $nthreads=16// 设置退出模式,支持[ timeout | alldone | firstdone ]set mode quit firstdone// fileset:定义一组测试中用的files// name=bigfileset:必须指定 - fileset的名称,后面flowop中用到// path=$dir:必须指定 - 创建测试文件的目录// size=$meanfilesize:可选,关键字也可以为filesize,默认为1KB - 测试文件的size// entries=$nfiles:可选,默认位1024 - fileset中的file个数// dirwidth=$meandirwidth:可选,默认为0 - 每个目录中创建的file个数define fileset name=bigfileset,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth// process:定义处理过程// name=filecreate:必须指定 - 处理过程的名称// instances=1:可选,默认为1 - 处理过程的进程数define process name=filecreate,instances=1{// thread:process中的一个thread// name=filecreatethread:必须指定 - 处理线程的名称// memsize=10m:必须指定 - 线程启动后初始化为0的内存大小,用于read/write flowop// instances=$nthreads:可选,默认为1 - 创建的线程数thread name=filecreatethread,memsize=10m,instances=$nthreads{// flowop:定义处理流程中的每一步// createfile/writewholefile/closefile:flowop的关键字,每个代表不同的操作// name=$name:flowop的名称// filesetname=bigfileset:指定op操作的fileset// fd=1:指定file descriptor的值,在应用允许文件被多次open的场景中有用// iosize=$iosize:指定读写的iosizeflowop createfile name=createfile1,filesetname=bigfileset,fd=1flowop writewholefile name=writefile1,fd=1,iosize=$iosizeflowop closefile name=closefile1,fd=1}}echo "Createfiles Version 3.0 personality successfully loaded”// 开始运行filebench测试// 格式:run [<runtime>],<runtime>不指定的话,默认为60srun 60
阅读全文
0 0
- filesystem测试工具之filebench
- ceph存储 ceph文件系统测试工具filebench介绍
- 服务器测试工具【Netperf、NetIQ Chariot、NetBench、ServerBench、FileBench、BenchMark Factory等】
- boost filesystem测试
- filebench介绍
- filebench介绍
- 测试工具之IOMETER
- 应用程序之测试工具
- 学习boost之filesystem
- Hadoop学习之FileSystem
- hadoop之FileSystem操作
- HDFS学习之FileSystem
- 测试工具之 LoadRunner & WinRunner
- 安全测试之必备工具
- 基准测试工具之sysbench
- 自动化测试工具之 selenium
- 性能测试工具之研究
- 测试工具之fiddler使用
- 在centos7中安装nodejs(npm )8.1.4
- OpenAirInterface仿真LTE PHY(物理层)说明
- js获取当前日期的前一天、一月、一年的日期 明天、后天
- hdu2586(最近公共祖先)
- 六.通过接口统计张江的小鸣单车数量
- filesystem测试工具之filebench
- Java精选笔记_Servlet事件监听器
- 1029. Median (25)
- SpringBoot属性配置实战(application.properties)
- C#方法的参数关键字:ref、out、params
- Windows下Sublime Text 默认打开方式问题解决办法
- ida手动加载指定模块的符号
- 敏捷实践详解
- CRNN add digits