一、vdbench安装1、安装java:java -version(vdbench的运行依赖于java)

2、检测vdbench能够使用:进入vdbench相应目录下./vdbench -t 来测试一下vdbench的可用性,如果正常,会在目录下自动生成一个output目录。root@node1:/home/vdbench/vdbench50406# ./vdbench -t如果报错,则需修改vdbench的权限:root@node03:/home/vdbench/vdbench50406# chmod 777 vdbench二、执行(下面的例子是针对文件系统)1、配置参考文件目录vdbench504/examples/filesys如:将红色/dir1改为具体的测试目录或者说是挂载点,其它参数第三小节会做详细解释[root@sdosspststorage10 back]# cat seq_write

** Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.*

** Author: Henk Vandenbergh.*

* Sequentially write randomly selected files.** 'format=yes' first creates (depth*width*files) 1000 128k files.* Test then will have eight threads each randomly select a file and sequentially* write it. At EOF a new file is selected.** Note: the amount of files and the total combined file size in this test* guarantees that most if not all of the i/o activity is done from cache.* Increase the amount of files and/or the file size to make sure that some* real disk i/o activity is done.*

fsd=fsd1,anchor=/dir1,depth=1,width=1,files=1000,size=128k

fwd=fwd1,fsd=fsd1,operation=write,xfersize=4k,fileio=sequential,fileselect=random,threads=8

rd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1

2、执行:/mnt/data2/ossfuse/vdbench504/vdbench -f seq_write -jn -o ./my/vdbench的详细目录 配置文件 指定output目录

三、vdbench文件系统测试——详细参数说明:对于一个文件系统,配置以下参数:(1)HD:主机定义。与虚拟块设备相同。(2)FSD:文件系统定义fsd= 标识文件系统定义的名称anchor= 将在其中创建目录结构的目录width= 要在定位符下创建的目录数depth= 要在定位符下创建的级别数files= 要在最低级别创建的文件数sizes= (size,size,...) 将创建的文件大小distribution= bottom(如果希望仅在最低级别创建文件)和 all(如果希望在所有目录中创建文件)openflags= 用于打开一个文件系统 (Solaris) 的 flag_list

(3)FWD:文件系统工作负载定义fwd= 标识文件系统工作负载定义的名称。fsd= 要使用的文件系统定义的 ID。host= 要用于此工作负载的主机的 ID。fileio= random 或 sequential,表示文件 I/O 将执行的方式。fileselect= random 或 sequential,标识选择文件或目录的方式。xfersizes= 数据传输(读取和写入操作)处理的数据大小。operation= mkdir、rmdir、create、delete、open、close、read、write、getattr 和 setattr。选择要执行的单个文件操作。rdpct= (仅)读取和写入操作的百分比。threads= 此工作负载的并发线程数量。每个线程需要至少 1 个文件。

(4)RD:运行定义fwd= 要使用的文件系统工作负载定义的 ID。fwdrate= 每秒执行的文件系统操作数量。format= yes / no / only / restart / clean / directories。在开始运行之前要执行的操作。yes:是每次都会先删除目录文件,再重新创建restart:每次起的时候会先校验文件、目录是否全,不全的补上no:不校验文件目录直接跑,事先最好将文件灌好

operations= 覆盖 fwd 操作。选项相同。vdbench文件系统测试Example:fsd=fsd1,anchor=/mnt/cephfs02,depth=3,width=10,files=20,size(512,50,4k,50),openflags=o-directfwd=fwd1,fsd=fsd1,operation=write,xfersize=(4k,15,8k,35,1M,50),fileio=random,fileselect=random,threads=32rd=rd1,fwd=fwd1,fwdrate=max,format=yes,elapsed=20,interval=1

3、运行脚本root@node1:/home/vdbench/vdbench50406# ./vdbench -f examples/filesys/create_files -jn其中-jn是为了做数据校验,目前还不太懂。

4、输出结果会回写输出一大堆东西,如果没有出现错误,最后会出现:Vdbench execution completed successfully. Output directory: /home/vdbench/vdbench50406/output每次运行后,vdbench 会创建一个包含以下文件的output文件夹:(1)errorlog.html——当为测试启用了数据验证(-jn)时,它可包含一些数据块中的错误的相关信息:无效的密钥读取无效的 lba 读取(一个扇区的逻辑字节地址)无效的 SD 或 FSD 名称读取数据损坏,即使在使用错误的 lba 或密钥时数据损坏坏扇区(2)flatfile.html——包含 vdbench 生成的一种逐列的 ASCII 格式的信息。(3)histogram.html——一种包含报告柱状图的响应时间、文本格式的文件。(4)logfile.html——包含 Java 代码写入控制台窗口的每行信息的副本。logfile.html 主要用于调试用途(5)parmfile.html——显示已包含用于测试的每项内容的最终结果(6)resourceN-M.html、resourceN.html、resourceN.var_adm_msgs.html摘要报告、stdout/stderr 报告、主机 N 的摘要报告最后 “nn” 行文件 /var/adm/messages 和 /var/adm/messages。每个 M 个 JVM/Slave 的目标主机 N 和主机 N 上为 0。(7)sdN.histogram.html、sdN.html——每个 N 存储定义的柱状图和存储定义 “N” 报告。(8)summary.html——主要报告文件,显示为在每个报告间隔的每次运行生成的总工作负载,以及除第一个间隔外的所有间隔的加权平均值。interval:报告间隔序号

ReqstdOps是指每秒读的次数(一次读的大小是配置文件配置的xfersize=8k)

I/O rate:每秒观察到的平均 I/O 速率MB sec:传输的数据的平均 MB 数bytes I/O:平均数据传输大小read pct:平均读取百分比resp time:以读/写请求持续时间度量的平均响应时间。所有 vdbench 时间都以毫秒为单位。resp max:在此间隔中观察到的最大响应时间。最后一行包含最大值总数。resp stddev:响应时间的标准偏差cpu% sys+usr:处理器繁忙 = 100(系统 + 用户时间)(Solaris、Windows、Linux)cpu% sys:处理器利用率:系统时间(9)swat_mon.txt,swat_mon_total.txtvdbench 与 Sun StorageTekTM Workload Analysis Tool (Swat) Trace Facility (STF) 相结合,支持重放使用 Swat 创建的一个轨迹的 I/O 工作负载。Swat 使用 Create Replay File 选项创建和处理的轨迹文件会创建文件 flatfile.bin(flatfile.bin.gz 用于 vdbench403 和更高版本),其中包含 Swat 所识别的每个 I/O 操作的一条记录。这些文件包含一个格式化的报告,可将该报告导入 Swat Performance Monitor (SPM) 中来创建性能图表。四、vdbench裸盘测试——详细参数说明:1、对于一个块设备,配置以下参数:(1)HD:主机定义• 如果您希望展示当前主机,则设置 hd= localhost。如果希望指定一个远程主机,hd= label。• system= IP 地址或网络名称。Example:hd=localhost,shell=ssh,vdbench=/home/vdbench/vdbench50406,user=roothd=hd1,system=10.147.0.15hd=hd2,system=10.147.37.173注意:vdbench=dir ,这里的目录是指所有主机上的目录,这就表示,所有主机上的vdbench目录都要一样,且对应的配置要放在vdbench下面;

(2)SD:存储定义• sd= 标识存储的名称。• host= 存储所在的主机的 ID。• lun= 原始磁盘、磁带或文件系统的名称。vdbench 也可为您创建一个磁盘。• threads= 对 SD 的最大并发 I/O 请求数量。默认为 8。• hitarea= 调整读取命中百分比的大小。默认为 1m。• openflags= 用于打开一个 lun 或一个文件的 flag_list,为了贴近真实场景,一般在这里选择o_direct,绕过缓存机制,直接写盘。Example:sd=default,threads=32,openflags=o_direct,size=340Gsd=sd1,hd=hd1,lun=/dev/sdbsd=sd2,hd=hd1,lun=/dev/sdcsd=sd3,hd=hd1,lun=/dev/sddsd=sd4,hd=hd1,lun=/dev/sdesd=sd5,hd=hd1,lun=/dev/sdfsd=sd6,hd=hd1,lun=/dev/sdgsd=sd7,hd=hd1,lun=/dev/sdhsd=sd8,hd=hd1,lun=/dev/sdisd=sd1,hd=hd2,lun=/dev/sdbsd=sd2,hd=hd2,lun=/dev/sdcsd=sd3,hd=hd2,lun=/dev/sddsd=sd4,hd=hd2,lun=/dev/sdesd=sd5,hd=hd2,lun=/dev/sdfsd=sd6,hd=hd2,lun=/dev/sdgsd=sd7,hd=hd2,lun=/dev/sdhsd=sd8,hd=hd2,lun=/dev/sdi此配置区分了主机1和主机2,第一行是针对以下所有sd的通用配置;

(3)WD:工作负载定义• wd= 标识工作负载的名称。• sd= 要使用的存储定义的 ID。• host= 要运行此工作负载的主机的 ID。默认设置为 localhost。• rdpct= 读取请求占请求总数的百分比。• rhpct= 读取命中百分比。默认设置为 0。• whpct= 写入命中百分比。默认设置为 0。• xfersize= 要传输的数据大小。默认设置为 4k。• seekpct= 随机寻道的百分比。可为随机值。• openflags= 用于打开一个 lun 或一个文件的 flag_list。• iorate= 此工作负载的固定 I/O 速率。Example:wd=wd1,sd=sd*,xfersize=4k,rdpct=0,seekpct=100此配置,配置了块的大小,读的比例和随机比例;

(4)RD:运行定义• rd= 标识运行的名称。• wd= 用于此运行的工作负载的 ID。• iorate= (#,#,...) 一个或多个 I/O 速率。(这里可以控制运行的iops,如果不控制就设置成max)• elapsed= time:以秒为单位的运行持续时间。默认设置为30。(设置长时间的运行,可能会使得数据更加稳定)• warmup= time:加热期,最终会被忽略。• distribution= I/O 请求的分布:指数、统一或确定性。• pause= 在下一次运行之前休眠的时间,以秒为单位。• openflags= 用于打开一个 lun 或一个文件的 flag_list。

Example:rd=run1,wd=wd1,iorate=max,el=100000,in=1,warmup=600此配置,配置了iorate(iops),运行时间,数据打印频率vdbench裸盘测试examples:hd=localhost,shell=ssh,vdbench=/home/vdbench/vdbench50406,user=roothd=hd1,system=200.200.213.30sd=default,threads=16,openflags=o_direct,size=30Gsd=sd1,hd=hd1,lun=/dev/sdbsd=sd2,hd=hd1,lun=/dev/sdcsd=sd3,hd=hd1,lun=/dev/sdbsd=sd4,hd=hd1,lun=/dev/sdcsd=sd5,hd=hd1,lun=/dev/sdbsd=sd6,hd=hd1,lun=/dev/sdcsd=sd7,hd=hd1,lun=/dev/sdbsd=sd8,hd=hd1,lun=/dev/sdcwd=wd1,sd=sd*,xfersize=4k,rdpct=0,seekpct=100rd=run1,wd=wd1,iorate=max,el=100000,in=1,warmup=600输出结果(部分):Aug 13, 2018 interval i/o MB/sec bytes read resp read write resp resp queue cpu% cpu%rate 1024**2 i/o pct time resp resp max stddev depth sys+u sys07:37:56.397 1 85.00 0.33 4096 0.00 2968.303 0.000 2968.303 6136.625 1844.150 308.5 83.4 23.907:37:56.459 2 83.00 0.32 4096 0.00 3184.730 0.000 3184.730 7861.568 1795.753 348.0 95.5 68.207:37:56.478 3 23.00 0.09 4096 0.00 3441.907 0.000 3441.907 5995.742 1011.997 61.2 71.4 42.907:37:56.493 4 0.00 0.00 0 0.00 0.000 0.000 0.000 0.000 0.000 0.7 NaN NaN07:37:56.647 5 0.00 0.00 0 0.00 0.000 0.000 0.000 0.000 0.000 0.8 83.3 33.307:38:01.132 6 0.00 0.00 0 0.00 0.000 0.000 0.000 0.000 0.000 40.8 85.7 33.307:38:01.162 7 44.00 0.17 4096 0.00 4070.731 0.000 4070.731 10818.509 2883.771 226.7 66.7 66.707:38:01.181 8 0.00 0.00 0 0.00 0.000 0.000 0.000 0.000 0.000 1.4 88.9 11.107:38:01.201 9 26.00 0.10 4096 0.00 4508.067 0.000 4508.067 15048.031 2778.336 27.7 91.7 55.607:38:01.630 10 8.00 0.03 4096 0.00 1806.932 0.000 1806.932 4328.737 1174.638 48.3 90.0 86.707:38:01.760 Detailed reporting is running behind; reporting of intervals 11-27 has been skipped.07:38:54.054 28 0.00 0.00 0 0.00 0.000 0.000 0.000 0.000 0.000 15.9 NaN NaN07:39:01.272 29 17.00 0.07 4096 0.00 4937.274 0.000 4937.274 7454.897 1474.074 39.4 NaN NaN07:39:03.858 Detailed reporting is running behind; reporting of intervals 30-42 has been skipped.07:39:59.480 89 84.00 0.33 4096 0.00 7764.630 0.000 7764.630 14029.705 2984.238 654.5 75.9 48.107:39:59.561 90 0.00 0.00 0 0.00 0.000 0.000 0.000 0.000 0.000 0.6 NaN NaN五、多客户端运行3 Vdbench运行及结果查看 ./vdbench -f parafile parafiile为配置文件,如果需要校验文件一致性可以可以指定-v参数,./vdbench -vf parafile 在vdbench安装目录下面有output目录,可以查看运行及输出结果,适用于windows及linux。

4 Linux下联机运行4.1 每个客户的都需要安装vdbench,路径保持一致4.2 SSH互相,选一个客户的为父节点,把每个子节点都信任父节点 父节点为93.93.41.5,子节点为93.93.41.6 ssh-keygen -t rsa 生成秘钥 chmod 755 /root/.ssh/ 修改生成秘钥的权限 scp /root/.ssh/id_rsa.pub 93.93.41.6:/root/.ssh/authorized_keys 拷贝公钥

4.3 验证SSH互信 在父节点上ssh每一个子节点,如果不需要输入秘钥就能登录,则互信成功。

4.4 多客户端配置文件hd=default,dbench=/home/Vdbench/,user=root,shell=sshhd=hd1,system=93.93.31.7hd=hd2,system=93.93.41.8hd=hd3,system=93.93.41.9fsd=fsd1,anchor=/tmp/yht/client1,depth=2,width=100,files=2000,size=100m,shared=yesfsd=fsd2,anchor=/tmp/yht/client2,depth=1,width=1000,files=2000,zies=(20m,40,100m,60),shared=yesfsd=fsd3,anchor=/tmp/yht/client3,depth=1000,width=1,files2000,size=1m,shared=yesfwd=fwd1,fsd=fsd1,host=hd1,operation=read,xfersize=(1m,40,64k,60),fileio=random,fileselect=sequantial,threads=32fwd=fwd2,fsd=fsd2,host=hd2,operation=write,xfersize=64k,fileio=random,fileselect=sequantial,threads=32fwd=fwd3,fsd=fsd3,host=hd3,rdpct=60,xfersize=4k,fileio=random,fileselect=sequantial,threads=32rd=rd1,fwd=(fwd1-fwd3),fwdrate=max,format=restart,elapsed=600,interval=10

elapsed:定义测试时间interval:测试结果刷新频率(1秒钟刷新一次测试结果)iorate=max:运行最大io性能openflags=o_direct:遍历整个磁盘(测试裸设备时使用)sd:使用之前定义过的sd。 seekpct:定义顺序(seq)或随机(random)。 rdpct定义读写比率:100为100%读,100%写。 xfersize:定义测试文件块大小。sd:存储描述,定义测试磁盘。 lun:定义测试磁盘为/dev/sdk。 threads:定义并行测试进程为64进程。 wd:工作描述,定义策略。fwdrate= 每秒执行的文件系统操作数量。format=yes / no / only / restart / clean / directories在开始运行之前要执行的操作yes:删除之前的文件结构,根据配置文件重新创建目录和文件no:默认使用原来的文件目录结构,不会创建文件restart:每次都会校验一下数据,是否达到背景数据要求,没有的话会继续创建目录和文件elapsed:以秒为单位的运行持续时间,默认设置为30s

脚本内容:(可按实际测试要求更改):sd=sd1,lun=/dev/sdk,threads=64,range=(100g,150g)或者range=(30,50)容量百分比wd=wd1,sd=sd*,seekpct=seq,rdpct=100,xfersize=1M,openflags=o_direct rw=rd1,wd=wd*,elapses=120,interval=1,iorate=max若是跑文件系统,先要挂载,之后在挂载的盘上建立文件,之后把脚本里的lun=/mnt/***就可以了

注:fsd中shared,vdbench不允许不同的slave之间共享同一个目录结构下的所有文件,因为这样会带来很大的开销,

但是它们允许共享同一个目录结构。加入设置了shared=yes,那么不同的slave可以平分一个目录下所有的文件

来进行访问,相当于每个slave有各自等分的访问区域,因此不能测试多个客户的对同一个文件的读写。一般不需要带

例如:./vdbench -f 1M_seq_read -o /1M 测试脚本名称为1M_seq_read,测试结果放在/1M目录下,到所在目录查看sd1

实际使用:针对ossfusecat random_read_100_100_300-100thhd=default,vdbench=/home/vdbench,user=root,shell=sshhd=hd1,system=10.244.124.90hd=hd2,system=10.244.124.91hd=hd3,system=10.244.124.92hd=hd4,system=10.244.124.93

fsd=fsd1,anchor=/mnt/sdoss/read_1023a1,depth=2,width=100,files=300,size=128kfsd=fsd2,anchor=/mnt/sdoss/read_1023a2,depth=2,width=100,files=300,size=128kfsd=fsd3,anchor=/mnt/sdoss/read_1023a3,depth=2,width=100,files=300,size=128kfsd=fsd4,anchor=/mnt/sdoss/read_1023a4,depth=2,width=100,files=300,size=128k

fwd=fwd1,fsd=fsd1,host=hd1,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd2,fsd=fsd2,host=hd2,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd3,fsd=fsd3,host=hd3,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd4,fsd=fsd4,host=hd4,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100

rd=rd1,fwd=fwd*,fwdrate=max,format=no,elapsed=600,interval=5

cat random_rw_100_100_300-100thhd=default,vdbench=/home/vdbench,user=root,shell=sshhd=hd1,system=10.244.124.90hd=hd2,system=10.244.124.91hd=hd3,system=10.244.124.92hd=hd4,system=10.244.124.93

fsd=fsd1,anchor=/mnt/sdoss/read_1023a1,depth=2,width=100,files=300,size=128kfsd=fsd2,anchor=/mnt/sdoss/read_1023a2,depth=2,width=100,files=300,size=128kfsd=fsd3,anchor=/mnt/sdoss/read_1023a3,depth=2,width=100,files=300,size=128kfsd=fsd4,anchor=/mnt/sdoss/read_1023a4,depth=2,width=100,files=300,size=128k

fwd=fwd1,fsd=fsd1,host=hd1,operation=write,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd2,fsd=fsd2,host=hd2,operation=write,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd3,fsd=fsd3,host=hd3,operation=write,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd4,fsd=fsd4,host=hd4,operation=write,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd5,fsd=fsd5,host=hd1,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd6,fsd=fsd6,host=hd2,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd7,fsd=fsd7,host=hd3,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd8,fsd=fsd8,host=hd4,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100

rd=rd1,fwd=fwd*,fwdrate=max,format=no,elapsed=600,interval=5

正常测试是测试内存的2倍比如内存是8g,那就是测试16g的数据16g/目录数=结果*1024*1024=转换的结果/文件大小=结果(结果为每个目录的文件数)根据上面的vdbench的配置文件就是:16/100^2=0.0016*1024*1024=1677/128=15 测试的时候需要将file写成15就可以了

报表解读:

默认输出的报表在程序目录下的output文件夹里面

(运行程序的时候也可以指定报表位置“vdbench –f parmfile –o C:\test\”)

在默认报表文件夹里面,主要看summary.html和totals.html

报表里面“starting RD=format_for_rd1”的条目数据是为了初始化测试环境(创建文件夹,空文件等),主要看下一个条目(自己定义的)

Summary.html:记录全部的数据信息

Totals.html:记录所有数据计算之后的平均数据

报错:

1、vdbench No read validations done during a Data Validation run

参考网站:

https://community.oracle.com/message/14179733#14179733

https://community.oracle.com/thread/3945285

执行命令去除-jn

-jn是支持数据校验,可以验证数据一致性,可以支持crash和reboot时的数据校验。

说明:如果想测试下vdbench数据一致性检查功能是否生效,可以将一个LUN通过iSCSI或者FC挂载到两台主机,然后一台主机对LUN进行vdbench写操作,另一台对该LUN进行dd写,观察Vdbench是否能实时检测到数据不一致。参考网站:

一、vdbench安装1、安装java:java -version(vdbench的运行依赖于java)

2、检测vdbench能够使用:进入vdbench相应目录下./vdbench -t 来测试一下vdbench的可用性,如果正常,会在目录下自动生成一个output目录。root@node1:/home/vdbench/vdbench50406# ./vdbench -t如果报错,则需修改vdbench的权限:root@node03:/home/vdbench/vdbench50406# chmod 777 vdbench二、执行(下面的例子是针对文件系统)1、配置参考文件目录vdbench504/examples/filesys如:将红色/dir1改为具体的测试目录或者说是挂载点,其它参数第三小节会做详细解释[root@sdosspststorage10 back]# cat seq_write

** Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.*

** Author: Henk Vandenbergh.*

* Sequentially write randomly selected files.** 'format=yes' first creates (depth*width*files) 1000 128k files.* Test then will have eight threads each randomly select a file and sequentially* write it. At EOF a new file is selected.** Note: the amount of files and the total combined file size in this test* guarantees that most if not all of the i/o activity is done from cache.* Increase the amount of files and/or the file size to make sure that some* real disk i/o activity is done.*

fsd=fsd1,anchor=/dir1,depth=1,width=1,files=1000,size=128k

fwd=fwd1,fsd=fsd1,operation=write,xfersize=4k,fileio=sequential,fileselect=random,threads=8

rd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1

2、执行:/mnt/data2/ossfuse/vdbench504/vdbench -f seq_write -jn -o ./my/vdbench的详细目录 配置文件 指定output目录

三、vdbench文件系统测试——详细参数说明:对于一个文件系统,配置以下参数:(1)HD:主机定义。与虚拟块设备相同。(2)FSD:文件系统定义fsd= 标识文件系统定义的名称anchor= 将在其中创建目录结构的目录width= 要在定位符下创建的目录数depth= 要在定位符下创建的级别数files= 要在最低级别创建的文件数sizes= (size,size,...) 将创建的文件大小distribution= bottom(如果希望仅在最低级别创建文件)和 all(如果希望在所有目录中创建文件)openflags= 用于打开一个文件系统 (Solaris) 的 flag_list

(3)FWD:文件系统工作负载定义fwd= 标识文件系统工作负载定义的名称。fsd= 要使用的文件系统定义的 ID。host= 要用于此工作负载的主机的 ID。fileio= random 或 sequential,表示文件 I/O 将执行的方式。fileselect= random 或 sequential,标识选择文件或目录的方式。xfersizes= 数据传输(读取和写入操作)处理的数据大小。operation= mkdir、rmdir、create、delete、open、close、read、write、getattr 和 setattr。选择要执行的单个文件操作。rdpct= (仅)读取和写入操作的百分比。threads= 此工作负载的并发线程数量。每个线程需要至少 1 个文件。

(4)RD:运行定义fwd= 要使用的文件系统工作负载定义的 ID。fwdrate= 每秒执行的文件系统操作数量。format= yes / no / only / restart / clean / directories。在开始运行之前要执行的操作。yes:是每次都会先删除目录文件,再重新创建restart:每次起的时候会先校验文件、目录是否全,不全的补上no:不校验文件目录直接跑,事先最好将文件灌好

operations= 覆盖 fwd 操作。选项相同。vdbench文件系统测试Example:fsd=fsd1,anchor=/mnt/cephfs02,depth=3,width=10,files=20,size(512,50,4k,50),openflags=o-directfwd=fwd1,fsd=fsd1,operation=write,xfersize=(4k,15,8k,35,1M,50),fileio=random,fileselect=random,threads=32rd=rd1,fwd=fwd1,fwdrate=max,format=yes,elapsed=20,interval=1

3、运行脚本root@node1:/home/vdbench/vdbench50406# ./vdbench -f examples/filesys/create_files -jn其中-jn是为了做数据校验,目前还不太懂。

4、输出结果会回写输出一大堆东西,如果没有出现错误,最后会出现:Vdbench execution completed successfully. Output directory: /home/vdbench/vdbench50406/output每次运行后,vdbench 会创建一个包含以下文件的output文件夹:(1)errorlog.html——当为测试启用了数据验证(-jn)时,它可包含一些数据块中的错误的相关信息:无效的密钥读取无效的 lba 读取(一个扇区的逻辑字节地址)无效的 SD 或 FSD 名称读取数据损坏,即使在使用错误的 lba 或密钥时数据损坏坏扇区(2)flatfile.html——包含 vdbench 生成的一种逐列的 ASCII 格式的信息。(3)histogram.html——一种包含报告柱状图的响应时间、文本格式的文件。(4)logfile.html——包含 Java 代码写入控制台窗口的每行信息的副本。logfile.html 主要用于调试用途(5)parmfile.html——显示已包含用于测试的每项内容的最终结果(6)resourceN-M.html、resourceN.html、resourceN.var_adm_msgs.html摘要报告、stdout/stderr 报告、主机 N 的摘要报告最后 “nn” 行文件 /var/adm/messages 和 /var/adm/messages。每个 M 个 JVM/Slave 的目标主机 N 和主机 N 上为 0。(7)sdN.histogram.html、sdN.html——每个 N 存储定义的柱状图和存储定义 “N” 报告。(8)summary.html——主要报告文件,显示为在每个报告间隔的每次运行生成的总工作负载,以及除第一个间隔外的所有间隔的加权平均值。interval:报告间隔序号

ReqstdOps是指每秒读的次数(一次读的大小是配置文件配置的xfersize=8k)

I/O rate:每秒观察到的平均 I/O 速率MB sec:传输的数据的平均 MB 数bytes I/O:平均数据传输大小read pct:平均读取百分比resp time:以读/写请求持续时间度量的平均响应时间。所有 vdbench 时间都以毫秒为单位。resp max:在此间隔中观察到的最大响应时间。最后一行包含最大值总数。resp stddev:响应时间的标准偏差cpu% sys+usr:处理器繁忙 = 100(系统 + 用户时间)(Solaris、Windows、Linux)cpu% sys:处理器利用率:系统时间(9)swat_mon.txt,swat_mon_total.txtvdbench 与 Sun StorageTekTM Workload Analysis Tool (Swat) Trace Facility (STF) 相结合,支持重放使用 Swat 创建的一个轨迹的 I/O 工作负载。Swat 使用 Create Replay File 选项创建和处理的轨迹文件会创建文件 flatfile.bin(flatfile.bin.gz 用于 vdbench403 和更高版本),其中包含 Swat 所识别的每个 I/O 操作的一条记录。这些文件包含一个格式化的报告,可将该报告导入 Swat Performance Monitor (SPM) 中来创建性能图表。四、vdbench裸盘测试——详细参数说明:1、对于一个块设备,配置以下参数:(1)HD:主机定义• 如果您希望展示当前主机,则设置 hd= localhost。如果希望指定一个远程主机,hd= label。• system= IP 地址或网络名称。Example:hd=localhost,shell=ssh,vdbench=/home/vdbench/vdbench50406,user=roothd=hd1,system=10.147.0.15hd=hd2,system=10.147.37.173注意:vdbench=dir ,这里的目录是指所有主机上的目录,这就表示,所有主机上的vdbench目录都要一样,且对应的配置要放在vdbench下面;

(2)SD:存储定义• sd= 标识存储的名称。• host= 存储所在的主机的 ID。• lun= 原始磁盘、磁带或文件系统的名称。vdbench 也可为您创建一个磁盘。• threads= 对 SD 的最大并发 I/O 请求数量。默认为 8。• hitarea= 调整读取命中百分比的大小。默认为 1m。• openflags= 用于打开一个 lun 或一个文件的 flag_list,为了贴近真实场景,一般在这里选择o_direct,绕过缓存机制,直接写盘。Example:sd=default,threads=32,openflags=o_direct,size=340Gsd=sd1,hd=hd1,lun=/dev/sdbsd=sd2,hd=hd1,lun=/dev/sdcsd=sd3,hd=hd1,lun=/dev/sddsd=sd4,hd=hd1,lun=/dev/sdesd=sd5,hd=hd1,lun=/dev/sdfsd=sd6,hd=hd1,lun=/dev/sdgsd=sd7,hd=hd1,lun=/dev/sdhsd=sd8,hd=hd1,lun=/dev/sdisd=sd1,hd=hd2,lun=/dev/sdbsd=sd2,hd=hd2,lun=/dev/sdcsd=sd3,hd=hd2,lun=/dev/sddsd=sd4,hd=hd2,lun=/dev/sdesd=sd5,hd=hd2,lun=/dev/sdfsd=sd6,hd=hd2,lun=/dev/sdgsd=sd7,hd=hd2,lun=/dev/sdhsd=sd8,hd=hd2,lun=/dev/sdi此配置区分了主机1和主机2,第一行是针对以下所有sd的通用配置;

(3)WD:工作负载定义• wd= 标识工作负载的名称。• sd= 要使用的存储定义的 ID。• host= 要运行此工作负载的主机的 ID。默认设置为 localhost。• rdpct= 读取请求占请求总数的百分比。• rhpct= 读取命中百分比。默认设置为 0。• whpct= 写入命中百分比。默认设置为 0。• xfersize= 要传输的数据大小。默认设置为 4k。• seekpct= 随机寻道的百分比。可为随机值。• openflags= 用于打开一个 lun 或一个文件的 flag_list。• iorate= 此工作负载的固定 I/O 速率。Example:wd=wd1,sd=sd*,xfersize=4k,rdpct=0,seekpct=100此配置,配置了块的大小,读的比例和随机比例;

(4)RD:运行定义• rd= 标识运行的名称。• wd= 用于此运行的工作负载的 ID。• iorate= (#,#,...) 一个或多个 I/O 速率。(这里可以控制运行的iops,如果不控制就设置成max)• elapsed= time:以秒为单位的运行持续时间。默认设置为30。(设置长时间的运行,可能会使得数据更加稳定)• warmup= time:加热期,最终会被忽略。• distribution= I/O 请求的分布:指数、统一或确定性。• pause= 在下一次运行之前休眠的时间,以秒为单位。• openflags= 用于打开一个 lun 或一个文件的 flag_list。

Example:rd=run1,wd=wd1,iorate=max,el=100000,in=1,warmup=600此配置,配置了iorate(iops),运行时间,数据打印频率vdbench裸盘测试examples:hd=localhost,shell=ssh,vdbench=/home/vdbench/vdbench50406,user=roothd=hd1,system=200.200.213.30sd=default,threads=16,openflags=o_direct,size=30Gsd=sd1,hd=hd1,lun=/dev/sdbsd=sd2,hd=hd1,lun=/dev/sdcsd=sd3,hd=hd1,lun=/dev/sdbsd=sd4,hd=hd1,lun=/dev/sdcsd=sd5,hd=hd1,lun=/dev/sdbsd=sd6,hd=hd1,lun=/dev/sdcsd=sd7,hd=hd1,lun=/dev/sdbsd=sd8,hd=hd1,lun=/dev/sdcwd=wd1,sd=sd*,xfersize=4k,rdpct=0,seekpct=100rd=run1,wd=wd1,iorate=max,el=100000,in=1,warmup=600输出结果(部分):Aug 13, 2018 interval i/o MB/sec bytes read resp read write resp resp queue cpu% cpu%rate 1024**2 i/o pct time resp resp max stddev depth sys+u sys07:37:56.397 1 85.00 0.33 4096 0.00 2968.303 0.000 2968.303 6136.625 1844.150 308.5 83.4 23.907:37:56.459 2 83.00 0.32 4096 0.00 3184.730 0.000 3184.730 7861.568 1795.753 348.0 95.5 68.207:37:56.478 3 23.00 0.09 4096 0.00 3441.907 0.000 3441.907 5995.742 1011.997 61.2 71.4 42.907:37:56.493 4 0.00 0.00 0 0.00 0.000 0.000 0.000 0.000 0.000 0.7 NaN NaN07:37:56.647 5 0.00 0.00 0 0.00 0.000 0.000 0.000 0.000 0.000 0.8 83.3 33.307:38:01.132 6 0.00 0.00 0 0.00 0.000 0.000 0.000 0.000 0.000 40.8 85.7 33.307:38:01.162 7 44.00 0.17 4096 0.00 4070.731 0.000 4070.731 10818.509 2883.771 226.7 66.7 66.707:38:01.181 8 0.00 0.00 0 0.00 0.000 0.000 0.000 0.000 0.000 1.4 88.9 11.107:38:01.201 9 26.00 0.10 4096 0.00 4508.067 0.000 4508.067 15048.031 2778.336 27.7 91.7 55.607:38:01.630 10 8.00 0.03 4096 0.00 1806.932 0.000 1806.932 4328.737 1174.638 48.3 90.0 86.707:38:01.760 Detailed reporting is running behind; reporting of intervals 11-27 has been skipped.07:38:54.054 28 0.00 0.00 0 0.00 0.000 0.000 0.000 0.000 0.000 15.9 NaN NaN07:39:01.272 29 17.00 0.07 4096 0.00 4937.274 0.000 4937.274 7454.897 1474.074 39.4 NaN NaN07:39:03.858 Detailed reporting is running behind; reporting of intervals 30-42 has been skipped.07:39:59.480 89 84.00 0.33 4096 0.00 7764.630 0.000 7764.630 14029.705 2984.238 654.5 75.9 48.107:39:59.561 90 0.00 0.00 0 0.00 0.000 0.000 0.000 0.000 0.000 0.6 NaN NaN五、多客户端运行3 Vdbench运行及结果查看 ./vdbench -f parafile parafiile为配置文件,如果需要校验文件一致性可以可以指定-v参数,./vdbench -vf parafile 在vdbench安装目录下面有output目录,可以查看运行及输出结果,适用于windows及linux。

4 Linux下联机运行4.1 每个客户的都需要安装vdbench,路径保持一致4.2 SSH互相,选一个客户的为父节点,把每个子节点都信任父节点 父节点为93.93.41.5,子节点为93.93.41.6 ssh-keygen -t rsa 生成秘钥 chmod 755 /root/.ssh/ 修改生成秘钥的权限 scp /root/.ssh/id_rsa.pub 93.93.41.6:/root/.ssh/authorized_keys 拷贝公钥

4.3 验证SSH互信 在父节点上ssh每一个子节点,如果不需要输入秘钥就能登录,则互信成功。

4.4 多客户端配置文件hd=default,dbench=/home/Vdbench/,user=root,shell=sshhd=hd1,system=93.93.31.7hd=hd2,system=93.93.41.8hd=hd3,system=93.93.41.9fsd=fsd1,anchor=/tmp/yht/client1,depth=2,width=100,files=2000,size=100m,shared=yesfsd=fsd2,anchor=/tmp/yht/client2,depth=1,width=1000,files=2000,zies=(20m,40,100m,60),shared=yesfsd=fsd3,anchor=/tmp/yht/client3,depth=1000,width=1,files2000,size=1m,shared=yesfwd=fwd1,fsd=fsd1,host=hd1,operation=read,xfersize=(1m,40,64k,60),fileio=random,fileselect=sequantial,threads=32fwd=fwd2,fsd=fsd2,host=hd2,operation=write,xfersize=64k,fileio=random,fileselect=sequantial,threads=32fwd=fwd3,fsd=fsd3,host=hd3,rdpct=60,xfersize=4k,fileio=random,fileselect=sequantial,threads=32rd=rd1,fwd=(fwd1-fwd3),fwdrate=max,format=restart,elapsed=600,interval=10

elapsed:定义测试时间interval:测试结果刷新频率(1秒钟刷新一次测试结果)iorate=max:运行最大io性能openflags=o_direct:遍历整个磁盘(测试裸设备时使用)sd:使用之前定义过的sd。 seekpct:定义顺序(seq)或随机(random)。 rdpct定义读写比率:100为100%读,100%写。 xfersize:定义测试文件块大小。sd:存储描述,定义测试磁盘。 lun:定义测试磁盘为/dev/sdk。 threads:定义并行测试进程为64进程。 wd:工作描述,定义策略。fwdrate= 每秒执行的文件系统操作数量。format=yes / no / only / restart / clean / directories在开始运行之前要执行的操作yes:删除之前的文件结构,根据配置文件重新创建目录和文件no:默认使用原来的文件目录结构,不会创建文件restart:每次都会校验一下数据,是否达到背景数据要求,没有的话会继续创建目录和文件elapsed:以秒为单位的运行持续时间,默认设置为30s

脚本内容:(可按实际测试要求更改):sd=sd1,lun=/dev/sdk,threads=64,range=(100g,150g)或者range=(30,50)容量百分比wd=wd1,sd=sd*,seekpct=seq,rdpct=100,xfersize=1M,openflags=o_direct rw=rd1,wd=wd*,elapses=120,interval=1,iorate=max若是跑文件系统,先要挂载,之后在挂载的盘上建立文件,之后把脚本里的lun=/mnt/***就可以了

注:fsd中shared,vdbench不允许不同的slave之间共享同一个目录结构下的所有文件,因为这样会带来很大的开销,

但是它们允许共享同一个目录结构。加入设置了shared=yes,那么不同的slave可以平分一个目录下所有的文件

来进行访问,相当于每个slave有各自等分的访问区域,因此不能测试多个客户的对同一个文件的读写。一般不需要带

例如:./vdbench -f 1M_seq_read -o /1M 测试脚本名称为1M_seq_read,测试结果放在/1M目录下,到所在目录查看sd1

实际使用:针对ossfusecat random_read_100_100_300-100thhd=default,vdbench=/home/vdbench,user=root,shell=sshhd=hd1,system=10.244.124.90hd=hd2,system=10.244.124.91hd=hd3,system=10.244.124.92hd=hd4,system=10.244.124.93

fsd=fsd1,anchor=/mnt/sdoss/read_1023a1,depth=2,width=100,files=300,size=128kfsd=fsd2,anchor=/mnt/sdoss/read_1023a2,depth=2,width=100,files=300,size=128kfsd=fsd3,anchor=/mnt/sdoss/read_1023a3,depth=2,width=100,files=300,size=128kfsd=fsd4,anchor=/mnt/sdoss/read_1023a4,depth=2,width=100,files=300,size=128k

fwd=fwd1,fsd=fsd1,host=hd1,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd2,fsd=fsd2,host=hd2,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd3,fsd=fsd3,host=hd3,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd4,fsd=fsd4,host=hd4,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100

rd=rd1,fwd=fwd*,fwdrate=max,format=no,elapsed=600,interval=5

cat random_rw_100_100_300-100thhd=default,vdbench=/home/vdbench,user=root,shell=sshhd=hd1,system=10.244.124.90hd=hd2,system=10.244.124.91hd=hd3,system=10.244.124.92hd=hd4,system=10.244.124.93

fsd=fsd1,anchor=/mnt/sdoss/read_1023a1,depth=2,width=100,files=300,size=128kfsd=fsd2,anchor=/mnt/sdoss/read_1023a2,depth=2,width=100,files=300,size=128kfsd=fsd3,anchor=/mnt/sdoss/read_1023a3,depth=2,width=100,files=300,size=128kfsd=fsd4,anchor=/mnt/sdoss/read_1023a4,depth=2,width=100,files=300,size=128k

fwd=fwd1,fsd=fsd1,host=hd1,operation=write,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd2,fsd=fsd2,host=hd2,operation=write,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd3,fsd=fsd3,host=hd3,operation=write,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd4,fsd=fsd4,host=hd4,operation=write,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd5,fsd=fsd5,host=hd1,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd6,fsd=fsd6,host=hd2,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd7,fsd=fsd7,host=hd3,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100fwd=fwd8,fsd=fsd8,host=hd4,operation=read,xfersize=8k,fileio=random,fileselect=random,threads=100

rd=rd1,fwd=fwd*,fwdrate=max,format=no,elapsed=600,interval=5

正常测试是测试内存的2倍比如内存是8g,那就是测试16g的数据16g/目录数=结果*1024*1024=转换的结果/文件大小=结果(结果为每个目录的文件数)根据上面的vdbench的配置文件就是:16/100^2=0.0016*1024*1024=1677/128=15 测试的时候需要将file写成15就可以了

报表解读:

默认输出的报表在程序目录下的output文件夹里面

(运行程序的时候也可以指定报表位置“vdbench –f parmfile –o C:\test\”)

在默认报表文件夹里面,主要看summary.html和totals.html

报表里面“starting RD=format_for_rd1”的条目数据是为了初始化测试环境(创建文件夹,空文件等),主要看下一个条目(自己定义的)

Summary.html:记录全部的数据信息

Totals.html:记录所有数据计算之后的平均数据

报错:

1、vdbench No read validations done during a Data Validation run

参考网站:

https://community.oracle.com/message/14179733#14179733

https://community.oracle.com/thread/3945285

执行命令去除-jn

-jn是支持数据校验,可以验证数据一致性,可以支持crash和reboot时的数据校验。

说明:如果想测试下vdbench数据一致性检查功能是否生效,可以将一个LUN通过iSCSI或者FC挂载到两台主机,然后一台主机对LUN进行vdbench写操作,另一台对该LUN进行dd写,观察Vdbench是否能实时检测到数据不一致。