【vdbench】vdbench配置文件参数含义
vdbench配置文件参数含义
- 一、随机读(random_read)
- 1.1 fsd (File System Definition) - 文件系统定义
- 1.2 fwd (File System Workload Definition) - 工作负载定义
- 1.3 rd (Run Definition) - 运行定义
- 二、混合读写(random_rw)
- 2.1 fsd (File System Definition) - 文件系统定义
- 2.2 fwd(File System Workload Definition) - 工作负载定义
- 2.2.1 fwd=default(默认参数)
- 2.2.2 fwd=fwd1(读取测试)
- 2.2.3 fwd=fwd2(写入测试)
- 作用
- 三、 随机写(random_write)
- 3.1 fsd (File System Definition) - 文件系统定义
- 3.2 fwd (File System Workload Definition) - 工作负载定义
- 3.3 rd(Run Definition) - 运行定义
- 四、顺序读(seq_read)
- 4.1 fsd(文件系统定义)
- 4.2 fwd (工作负载定义)
- 4.3 rd (运行定义)
- 五、 混合负载(读写并发)小文件顺序I/O(seq_rw)
- 5.1 文件系统定义 (fsd)
- 5.2 工作负载定义 (fwd)
- 5.2.1 默认参数 (fwd=default)
- 5.2.2 读取任务 (fwd1)
- 5.2.3 写入任务 (fwd2)
- 5.3 运行定义 (rd)
- 六、顺序写(seq_write)
- 6.1 文件系统定义 (fsd)
- 6.2 工作负载定义 (fwd)
- 6.4 运行定义 (rd)
一、随机读(random_read)
*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
**
* Author: Henk Vandenbergh.
** Random reads on 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 randomly
* read it. After 'stopafter=100' reads the file is closed and a new
* file is randomly 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=128kfwd=fwd1,fsd=fsd1,operation=read,xfersize=4k,fileio=random,
fileselect=random,stopafter=100,threads=8rd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1
1.1 fsd (File System Definition) - 文件系统定义
fsd=fsd1,anchor=/dir1,depth=1,width=1,files=1000,size=128k
fsd=fsd1
:定义了一个名为fsd1
的文件系统数据集。anchor=/dir1
:测试文件将创建在/dir1
目录下。depth=1
:目录层级深度为 1(仅在/dir1
下创建文件,不建子目录)。width=1
:每层目录下直接存放文件,不创建额外子目录。files=1000
:总共创建 1000 个文件。size=128k
:每个文件的大小是 128KB。
作用:在 /dir1
下生成 1000 个 128KB 的小文件,用于后续测试。
1.2 fwd (File System Workload Definition) - 工作负载定义
fwd=fwd1,fsd=fsd1,operation=read,xfersize=4k,fileio=random,fileselect=random,stopafter=100,threads=8
fwd=fwd1
:定义了一个名为fwd1
的工作负载。fsd=fsd1
:使用之前定义的fsd1
数据集(1000 个 128KB 文件)。operation=read
:测试模式是 读取(read)(不是写入或混合读写)。xfersize=4k
:每次 I/O 请求的大小是 4KB(模拟小块随机读)。fileio=random
:文件内的访问模式是 随机(random)(而非顺序)。fileselect=random
:文件选择模式是 随机(random)(从 1000 个文件中随机选一个读)。stopafter=100
:每个线程总共执行 100 次 I/O 操作 后停止。threads=8
:并发线程数是 8(模拟 8 个客户端同时访问)。
作用:8 个线程并发随机读取 /dir1
下的 1000 个文件,每次读 4KB,每个线程执行 100 次 I/O 后停止。
1.3 rd (Run Definition) - 运行定义
rd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1
rd=rd1
:定义了一个名为rd1
的运行任务。fwd=fwd\*
:运行所有匹配fwd*
的工作负载(这里只有fwd1
)。fwdrate=max
:以 最大速率 运行测试(尽可能高的 IOPS)。format=yes
:格式化(重新初始化) 文件系统数据(会清空/dir1
并重新生成 1000 个 128KB 文件)。elapsed=120
:测试总运行时间为 120 秒(2 分钟)。interval=1
:每隔 1 秒 输出一次性能统计信息。
作用:运行测试 2 分钟,期间每秒输出一次性能数据(IOPS、吞吐量、延迟等)。
二、混合读写(random_rw)
*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
**
* Author: Henk Vandenbergh.
** Random read and write of 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 do random
* reads. After 'stopafter=100' reads the file is closed and a new
* file is randomly selected.
* An other eight threads will do the same, but only for writes.
*
* 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=128kfwd=default,xfersize=4k,fileio=random,fileselect=random,threads=8,
stopafter=100
fwd=fwd1,fsd=fsd1,operation=read
fwd=fwd2,fsd=fsd1,operation=writerd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1
2.1 fsd (File System Definition) - 文件系统定义
fsd=fsd1,anchor=/dir1,depth=1,width=1,files=1000,size=128k
fsd=fsd1
:定义名为fsd1
的文件系统数据集。anchor=/dir1
:测试文件存放在/dir1
目录下。depth=1
:目录层级深度为 1(不创建子目录)。width=1
:每层目录下直接存放文件,不建子目录。files=1000
:创建 1000 个文件。size=128k
:每个文件大小 128KB。
作用:在 /dir1
下生成 1000 个 128KB 的小文件,用于后续测试。
2.2 fwd(File System Workload Definition) - 工作负载定义
2.2.1 fwd=default(默认参数)
fwd=default,xfersize=4k,fileio=random,fileselect=random,threads=8,stopafter=100
xfersize=4k
:每次 I/O 请求大小 4KB(小块随机 I/O)。fileio=random
:文件内访问模式为 随机(非顺序)。fileselect=random
:从 1000 个文件中 随机选择 文件进行读写。threads=8
:每个fwd
任务使用 8 个线程(并发数)。stopafter=100
:每个线程执行 100 次 I/O 操作 后停止(但测试最长运行elapsed=120
秒)。
2.2.2 fwd=fwd1(读取测试)
fwd=fwd1,fsd=fsd1,operation=read
operation=read
:测试 读取(Read) 性能。- 继承
fwd=default
的参数(4KB 随机读,8 线程,每个线程 100 次 I/O)。
2.2.3 fwd=fwd2(写入测试)
fwd=fwd2,fsd=fsd1,operation=write
operation=write
:测试 写入(Write) 性能。- 继承
fwd=default
的参数(4KB 随机写,8 线程,每个线程 100 次 I/O)。
作用
fwd1
:8 线程随机读取/dir1
下的 1000 个文件,每次读 4KB。fwd2
:8 线程随机写入/dir1
下的 1000 个文件,每次写 4KB。
三、 随机写(random_write)
*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
**
* Author: Henk Vandenbergh.
** Random writes on 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 randomly
* write it. After 'stopafter=100' writes the file is closed and a new
* file is randomly 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=128kfwd=fwd1,fsd=fsd1,operation=write,xfersize=4k,fileio=sequential,
fileselect=random,stopafter=100,threads=8rd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1
3.1 fsd (File System Definition) - 文件系统定义
fsd=fsd1,anchor=/dir1,depth=1,width=1,files=1000,size=128k
fsd=fsd1
:定义名为fsd1
的文件系统数据集。anchor=/dir1
:测试文件存放在/dir1
目录下。depth=1
:目录层级深度为 1(不创建子目录)。width=1
:每层目录下直接存放文件(不建子目录)。files=1000
:创建 1000 个文件。size=128k
:每个文件大小 128KB。
作用:在 /dir1
下生成 1000 个 128KB 的小文件,用于写入测试。
3.2 fwd (File System Workload Definition) - 工作负载定义
fwd=fwd1,fsd=fsd1,operation=write,xfersize=4k,fileio=sequential,fileselect=random,stopafter=100,threads=8
fwd=fwd1
:定义名为fwd1
的工作负载。fsd=fsd1
:使用fsd1
数据集(1000 个 128KB 文件)。operation=write
:测试 写入(Write) 性能。xfersize=4k
:每次 I/O 请求大小 4KB(小块写入)。fileio=sequential
:文件内访问模式为 顺序(Sequential)(即按顺序写入文件内容)。fileselect=random
:从 1000 个文件中 随机选择 目标文件(但写入方式是顺序的)。stopafter=100
:每个线程执行 100 次 I/O 操作 后停止。threads=8
:并发线程数为 8(模拟 8 个客户端同时写入)。
关键点:
fileio=sequential
+fileselect=random
:- 每个文件内部是顺序写入(如按 0→128KB 的顺序填充)。
- 但选择哪个文件是随机的(可能反复写同一个文件,也可能跳着写不同文件)。
- 适用场景:
- 模拟 日志写入(如 Kafka、数据库事务日志,文件内顺序写,但文件间随机选择)。
- 测试 小块顺序写入的吞吐量(如 4KB 顺序写入性能)。
3.3 rd(Run Definition) - 运行定义
rd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1
rd=rd1
:定义名为rd1
的运行任务。fwd=fwd\*
:运行所有匹配fwd*
的工作负载(这里只有fwd1
)。fwdrate=max
:以 最大速率 运行(尽可能高的 IOPS/吞吐量)。format=yes
:格式化(重新初始化) 文件系统数据(清空/dir1
并重新生成 1000 个 128KB 文件)。elapsed=120
:测试总运行时间 120 秒(2 分钟)。interval=1
:每隔 1 秒 输出一次性能统计信息。
作用:
- 准备阶段(
format=yes
):- 清空
/dir1
,重新生成 1000 个 128KB 的空文件。
- 清空
- 测试阶段:
- 8 个线程并发执行 4KB 顺序写入,每个线程写入 100 次 I/O(但最长运行 120 秒)。
- 每秒输出一次性能数据(IOPS、吞吐量、延迟等)。
四、顺序读(seq_read)
*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
**
* Author: Henk Vandenbergh.
** Sequentially read 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
* read 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=128kfwd=fwd1,fsd=fsd1,operation=read,xfersize=4k,fileio=sequential,
fileselect=random,threads=8rd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1
4.1 fsd(文件系统定义)
fsd=fsd1,anchor=/dir1,depth=1,width=1,files=1000,size=128k
- 作用:在
/dir1
目录下创建 1000 个文件,每个文件 128KB。 - 关键参数:
depth=1,width=1
:单层目录,无子目录。files=1000
:文件数量较多,适合测试高并发元数据性能。size=128k
:小文件测试,关注存储系统的元数据处理能力。
4.2 fwd (工作负载定义)
fwd=fwd1,fsd=fsd1,operation=read,xfersize=4k,fileio=sequential,fileselect=random,threads=8
-
核心行为:
- 8 个线程 并发执行 4KB 顺序读取。
- 每个文件内部顺序读取(
fileio=sequential
),但 随机选择文件(fileselect=random
)。
-
关键参数:
参数 说明 测试意义 operation=read
纯读取测试 测试存储读取带宽和 IOPS xfersize=4k
4KB 小块读取 模拟数据库索引等小 I/O 场景 fileio=sequential
文件内顺序读 最大化磁盘吞吐量 fileselect=random
随机选文件 增加元数据压力 threads=8
8 并发线程 模拟多客户端访问
4.3 rd (运行定义)
rd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1
- 执行流程:
format=yes
:先清空/dir1
并重新生成 1000 个 128KB 文件。- 持续运行 120 秒(
elapsed=120
),每秒输出一次性能数据(interval=1
)。 fwdrate=max
:以最大速率运行(压测存储极限性能)。
五、 混合负载(读写并发)小文件顺序I/O(seq_rw)
*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
**
* Author: Henk Vandenbergh.
** Sequentially read and 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
* read it. At EOF a new file is selected.
* An other eight threads will do the same, but only for writes.
*
* 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=128kfwd=default,xfersize=4k,fileio=sequential,fileselect=random,threads=8
fwd=fwd1,fsd=fsd1,operation=read
fwd=fwd2,fsd=fsd1,operation=writerd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1
5.1 文件系统定义 (fsd)
fsd=fsd1,anchor=/dir1,depth=1,width=1,files=1000,size=128k
- 作用:在
/dir1
目录下创建 1000 个 128KB 的小文件。 - 关键特性:
- 单层目录结构(
depth=1, width=1
)。 - 小文件测试(
size=128k
),重点关注存储系统的 元数据处理能力 和 小文件吞吐量。
- 单层目录结构(
5.2 工作负载定义 (fwd)
5.2.1 默认参数 (fwd=default)
fwd=default,xfersize=4k,fileio=sequential,fileselect=random,threads=8
- 全局默认设置:
xfersize=4k
:4KB 小块 I/O(模拟数据库/日志类操作)。fileio=sequential
:文件内顺序访问(但见下方注意事项)。fileselect=random
:随机选择文件(从 1000 个文件中随机选)。threads=8
:每个 fwd 任务 8 线程。
5.2.2 读取任务 (fwd1)
fwd=fwd1,fsd=fsd1,operation=read
- 继承默认参数,执行:
- 8 线程顺序读取(每个线程从随机选择的文件中 顺序读 4KB)。
5.2.3 写入任务 (fwd2)
fwd=fwd2,fsd=fsd1,operation=write
- 继承默认参数,执行:
- 8 线程顺序写入(每个线程向随机选择的文件中 顺序写 4KB)。
5.3 运行定义 (rd)
rd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1
- 执行流程:
format=yes
:清空/dir1
并重新生成 1000 个 128KB 文件。- 并发运行
fwd1
(读)和fwd2
(写):- 总计 16 个线程(8 读 + 8 写)。
- 每个线程对文件 顺序 I/O,但文件选择是随机的。
- 持续 120 秒,每秒输出一次性能数据。
六、顺序写(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=128kfwd=fwd1,fsd=fsd1,operation=write,xfersize=4k,fileio=sequential,
fileselect=random,threads=8rd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1
6.1 文件系统定义 (fsd)
fsd=fsd1,anchor=/dir1,depth=1,width=1,files=1000,size=128k
- 作用:在
/dir1
目录下创建 1000 个 128KB 的小文件。 - 关键点:
- 单层扁平目录结构(
depth=1, width=1
)。 - 小文件测试(
size=128k
),重点评估:- 文件系统元数据性能(如 inode 处理能力)
- 存储设备的小文件写入吞吐量
- 单层扁平目录结构(
6.2 工作负载定义 (fwd)
fwd=fwd1,fsd=fsd1,operation=write,xfersize=4k,fileio=sequential,fileselect=random,threads=8
-
核心行为:
- 8 个线程并发执行 4KB 顺序写入
- 每个文件内部顺序写入(
fileio=sequential
) - 随机选择目标文件(
fileselect=random
,从1000个文件中随机选)
-
关键参数解析:
参数 说明 测试意义 operation=write
纯写入测试 评估写入带宽和延迟 xfersize=4k
4KB 小块写入 模拟日志/数据库类小I/O场景 fileio=sequential
文件内顺序写 最大化写入吞吐量 fileselect=random
随机选文件 增加目录查找压力 threads=8
8并发线程 模拟多客户端写入
6.4 运行定义 (rd)
rd=rd1,fwd=fwd*,fwdrate=max,format=yes,elapsed=120,interval=1
- 执行流程:
format=yes
:清空/dir1
并重新生成 1000 个空文件(128KB)。- 持续写入 120秒(
elapsed=120
),每秒输出性能数据(interval=1
)。 fwdrate=max
:以最大速率压测(测试写入性能极限)。