提交 340cf5a4 编写于 作者: Z zhaoyanggh

docs: refine taosbenchmark page

上级 51952714
......@@ -12,9 +12,9 @@ taosBenchmark (曾用名 taosdemo ) 是一个用于测试 TDengine 产品性能
taosBenchmark 有两种安装方式:
- 安装 TDengine 官方安装包的同时会自动安装 taosBenchmark, 详情请参考[ TDengine 安装](#/get-started)
- 安装 TDengine 官方安装包的同时会自动安装 taosBenchmark, 详情请参考[ TDengine 安装](#/get-started)
- 单独编译 taos-tools 并安装, 详情请参考 [taos-tools](#https://github.com/taosdata/taos-tools) 仓库。
- 单独编译 taos-tools 并安装, 详情请参考 [taos-tools](#https://github.com/taosdata/taos-tools) 仓库。
## 运行
......@@ -65,87 +65,87 @@ taosBenchmark -f <json file>
```json
{
"filetype": "insert",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"connection_pool_size": 8,
"thread_count": 4,
"result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no",
"insert_interval": 0,
"interlace_rows": 100,
"num_of_records_per_req": 100,
"prepared_rand": 10000,
"chinese": "no",
"databases": [
{
"dbinfo": {
"name": "db",
"drop": "yes",
"replica": 1,
"days": 10,
"cache": 16,
"blocks": 8,
"precision": "ms",
"keep": 3650,
"minRows": 100,
"maxRows": 4096,
"comp": 2,
"walLevel": 1,
"cachelast": 0,
"quorum": 1,
"fsync": 3000,
"update": 0
},
"super_tables": [
{
"name": "stb",
"child_table_exists": "no",
"childtable_count": 100,
"childtable_prefix": "stb_",
"escape_character": "yes",
"auto_create_table": "no",
"batch_create_tbl_num": 5,
"data_source": "rand",
"insert_mode": "taosc",
"non_stop_mode": "no",
"line_protocol": "line",
"insert_rows": 100000,
"childtable_limit": 10,
"childtable_offset": 100,
"interlace_rows": 0,
"insert_interval": 0,
"partial_col_num": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 10,
"start_timestamp": "2020-10-01 00:00:00.000",
"sample_format": "csv",
"sample_file": "./sample.csv",
"use_sample_ts": "no",
"tags_file": "",
"columns": [
{ "type": "INT", "name": "id" },
{ "type": "DOUBLE", "count": 10 },
{ "type": "BINARY", "len": 16, "count": 3 },
{ "type": "BINARY", "len": 32, "count": 6 }
],
"tags": [
{ "type": "TINYINT", "count": 2, "max": 10, "min": 98 },
{
"type": "BINARY",
"len": 16,
"count": 5,
"values": ["beijing", "shanghai"]
}
]
}
]
}
]
"filetype": "insert",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"connection_pool_size": 8,
"thread_count": 4,
"result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no",
"insert_interval": 0,
"interlace_rows": 100,
"num_of_records_per_req": 100,
"prepared_rand": 10000,
"chinese": "no",
"databases": [
{
"dbinfo": {
"name": "db",
"drop": "yes",
"replica": 1,
"days": 10,
"cache": 16,
"blocks": 8,
"precision": "ms",
"keep": 3650,
"minRows": 100,
"maxRows": 4096,
"comp": 2,
"walLevel": 1,
"cachelast": 0,
"quorum": 1,
"fsync": 3000,
"update": 0
},
"super_tables": [
{
"name": "stb",
"child_table_exists": "no",
"childtable_count": 100,
"childtable_prefix": "stb_",
"escape_character": "yes",
"auto_create_table": "no",
"batch_create_tbl_num": 5,
"data_source": "rand",
"insert_mode": "taosc",
"non_stop_mode": "no",
"line_protocol": "line",
"insert_rows": 100000,
"childtable_limit": 10,
"childtable_offset": 100,
"interlace_rows": 0,
"insert_interval": 0,
"partial_col_num": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 10,
"start_timestamp": "2020-10-01 00:00:00.000",
"sample_format": "csv",
"sample_file": "./sample.csv",
"use_sample_ts": "no",
"tags_file": "",
"columns": [
{ "type": "INT", "name": "id" },
{ "type": "DOUBLE", "count": 10 },
{ "type": "BINARY", "len": 16, "count": 3 },
{ "type": "BINARY", "len": 32, "count": 6 }
],
"tags": [
{ "type": "TINYINT", "count": 2, "max": 10, "min": 98 },
{
"type": "BINARY",
"len": 16,
"count": 5,
"values": ["beijing", "shanghai"]
}
]
}
]
}
]
}
```
......@@ -158,41 +158,41 @@ taosBenchmark -f <json file>
```json
{
"filetype": "query",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"confirm_parameter_prompt": "no",
"databases": "db",
"query_times": 2,
"query_mode": "taosc",
"specified_table_query": {
"query_interval": 1,
"concurrent": 3,
"sqls": [
{
"sql": "select last_row(*) from stb0 ",
"result": "./query_res0.txt"
},
{
"sql": "select count(*) from stb00_1",
"result": "./query_res1.txt"
}
]
},
"super_table_query": {
"stblname": "stb1",
"query_interval": 1,
"threads": 3,
"sqls": [
{
"sql": "select last_row(ts) from xxxx",
"result": "./query_res2.txt"
}
]
}
"filetype": "query",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"confirm_parameter_prompt": "no",
"databases": "db",
"query_times": 2,
"query_mode": "taosc",
"specified_table_query": {
"query_interval": 1,
"concurrent": 3,
"sqls": [
{
"sql": "select last_row(*) from stb0 ",
"result": "./query_res0.txt"
},
{
"sql": "select count(*) from stb00_1",
"result": "./query_res1.txt"
}
]
},
"super_table_query": {
"stblname": "stb1",
"query_interval": 1,
"threads": 3,
"sqls": [
{
"sql": "select last_row(ts) from xxxx",
"result": "./query_res2.txt"
}
]
}
}
```
......@@ -205,39 +205,39 @@ taosBenchmark -f <json file>
```json
{
"filetype": "subscribe",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"databases": "db",
"confirm_parameter_prompt": "no",
"specified_table_query": {
"concurrent": 1,
"interval": 0,
"restart": "yes",
"keepProgress": "yes",
"sqls": [
{
"sql": "select * from stb00_0 ;",
"result": "./subscribe_res0.txt"
}
]
},
"super_table_query": {
"stblname": "stb0",
"threads": 1,
"interval": 10000,
"restart": "yes",
"keepProgress": "yes",
"sqls": [
{
"sql": "select * from xxxx where ts > '2021-02-25 11:35:00.000' ;",
"result": "./subscribe_res1.txt"
}
]
}
"filetype": "subscribe",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"databases": "db",
"confirm_parameter_prompt": "no",
"specified_table_query": {
"concurrent": 1,
"interval": 0,
"restart": "yes",
"keepProgress": "yes",
"sqls": [
{
"sql": "select * from stb00_0 ;",
"result": "./subscribe_res0.txt"
}
]
},
"super_table_query": {
"stblname": "stb0",
"threads": 1,
"interval": 10000,
"restart": "yes",
"keepProgress": "yes",
"sqls": [
{
"sql": "select * from xxxx where ts > '2021-02-25 11:35:00.000' ;",
"result": "./subscribe_res1.txt"
}
]
}
}
```
......@@ -252,16 +252,16 @@ taosBenchmark -f <json file>
TDengine 集群配置文件所在的目录,默认路径是 /etc/taos 。
- **-h/--host <host\>** :
指定要连接的 TDengine 服务端的 FQDN,默认值为 localhost。
指定要连接的 TDengine 服务端的 FQDN,默认值为 localhost
- **-P/--port <port\>** :
要连接的 TDengine 服务器的端口号,默认值为 6030。
要连接的 TDengine 服务器的端口号,默认值为 6030
- **-I/--interface <insertMode\>** :
插入模式,可选项有 taosc, rest, stmt, sml, sml-rest, 分别对应普通写入、restful 接口写入、参数绑定接口写入、schemaless 接口写入、restful schemaless 接口写入 (由 taosAdapter 提供)。默认值为 taosc
插入模式,可选项有 taosc, rest, stmt, sml, sml-rest, 分别对应普通写入、restful 接口写入、参数绑定接口写入、schemaless 接口写入、restful schemaless 接口写入 (由 taosAdapter 提供)。默认值为 taosc。
- **-u/--user <user\>** :
用于连接 TDengine 服务端的用户名,默认为 root
用于连接 TDengine 服务端的用户名,默认为 root
- **-p/--password <passwd\>** :
用于连接 TDengine 服务端的密码,默认值为 taosdata。
......@@ -270,7 +270,7 @@ taosBenchmark -f <json file>
结果输出文件的路径,默认值为 ./output.txt。
- **-T/--thread <threadNum\>** :
插入数据的线程数量,默认为 8。
插入数据的线程数量,默认为 8
- **-B/--interlace-rows <rowNum\>** :
启用交错插入模式并同时指定向每个子表每次插入的数据行数。交错插入模式是指依次向每张子表插入由本参数所指定的行数并重复这个过程,直到所有子表的数据都插入完成。默认值为 0, 即向一张子表完成数据插入后才会向下一张子表进行数据插入。
......@@ -294,10 +294,10 @@ taosBenchmark -f <json file>
所使用的数据库的名称,默认值为 test 。
- **-b/--data-type <colType\>** :
超级表的数据列的类型。如果不使用则默认为有三个数据列,其类型分别为 FLOAT, INT, FLOAT。
超级表的数据列的类型。如果不使用则默认为有三个数据列,其类型分别为 FLOAT, INT, FLOAT
- **-l/--columns <colNum\>** :
超级表的数据列的总数量。如果同时设置了该参数和 `-b/--data-type`,则最后的结果列数为两者取大。如果本参数指定的数量大于 `-b/--data-type` 指定的列数,则未指定的列类型默认为 INT, 例如: `-l 5 -b float,double`, 那么最后的列为 `FLOAT,DOUBLE,INT,INT,INT`。如果 columns 指定的数量小于或等于 `-b/--data-type` 指定的列数,则结果为 `-b/--data-type` 指定的列和类型,例如: `-l 3 -b float,double,float,bigint`,那么最后的列为 `FLOAT,DOUBLE,FLOAT,BIGINT`
超级表的数据列的总数量。如果同时设置了该参数和 `-b/--data-type`,则最后的结果列数为两者取大。如果本参数指定的数量大于 `-b/--data-type` 指定的列数,则未指定的列类型默认为 INT, 例如: `-l 5 -b float,double`, 那么最后的列为 `FLOAT,DOUBLE,INT,INT,INT`。如果 columns 指定的数量小于或等于 `-b/--data-type` 指定的列数,则结果为 `-b/--data-type` 指定的列和类型,例如: `-l 3 -b float,double,float,bigint`,那么最后的列为 `FLOAT,DOUBLE,FLOAT,BIGINT`
- **-A/--tag-type <tagType\>** :
超级表的标签列类型。nchar 和 binary 类型可以同时设置长度,例如:
......@@ -368,62 +368,62 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
- **port** : 要连接的 TDengine 服务器的端口号,默认值为 6030。
- **user** : 用于连接 TDengine 服务端的用户名,默认为 root
- **user** : 用于连接 TDengine 服务端的用户名,默认为 root
- **password** : 用于连接 TDengine 服务端的密码,默认值为 taosdata。
### 插入场景配置参数
查询场景下 `filetype` 必须设置为 `insert`,该参数及其它通用参数详见[通用配置参数](#通用配置参数)
插入场景下 `filetype` 必须设置为 `insert`,该参数及其它通用参数详见[通用配置参数](#通用配置参数)
#### 数据库相关配置参数
创建数据库时的相关参数在 json 配置文件中的 `dbinfo` 中配置,具体参数如下。这些参数与 TDengine 中 `create database` 时所指定的数据库参数相对应。
- **name** : 数据库名
- **name** : 数据库名
- **drop** : 插入前是否删除数据库,默认为 true
- **drop** : 插入前是否删除数据库,默认为 true
- **replica** : 创建数据库时指定的副本数
- **replica** : 创建数据库时指定的副本数
- **days** : 单个数据文件中存储数据的时间跨度,默认值为 10
- **days** : 单个数据文件中存储数据的时间跨度,默认值为 10
- **cache** : 缓存块的大小,单位是 MB,默认值是 16
- **cache** : 缓存块的大小,单位是 MB,默认值是 16
- **blocks** : 每个 vnode 中缓存块的数量,默认为 6
- **blocks** : 每个 vnode 中缓存块的数量,默认为 6
- **precision** : 数据库时间精度,默认值为 "ms"
- **precision** : 数据库时间精度,默认值为 "ms"
- **keep** : 保留数据的天数,默认值为 3650
- **keep** : 保留数据的天数,默认值为 3650
- **minRows** : 文件块中的最小记录数,默认值为 100
- **minRows** : 文件块中的最小记录数,默认值为 100
- **maxRows** : 文件块中的最大记录数,默认值为 4096
- **maxRows** : 文件块中的最大记录数,默认值为 4096
- **comp** : 文件压缩标志,默认值为 2
- **comp** : 文件压缩标志,默认值为 2
- **walLevel** : WAL 级别,默认为 1
- **walLevel** : WAL 级别,默认为 1
- **cacheLast** : 是否允许将每个表的最后一条记录保留在内存中,默认值为 0,可选值为 0,1,2,3
- **cacheLast** : 是否允许将每个表的最后一条记录保留在内存中,默认值为 0,可选值为 0,1,2,3
- **quorum** : 多副本模式下的写确认数量,默认值为 1
- **quorum** : 多副本模式下的写确认数量,默认值为 1
- **fsync** : 当 wal 设置为 2 时,fsync 的间隔时间,单位为 ms,默认值为 3000
- **fsync** : 当 wal 设置为 2 时,fsync 的间隔时间,单位为 ms,默认值为 3000
- **update** : 是否支持数据更新,默认值为 0, 可选值为 0, 1, 2
- **update** : 是否支持数据更新,默认值为 0, 可选值为 0, 1, 2
#### 超级表相关配置参数
创建超级表时的相关参数在 json 配置文件中的 `super_tables` 中配置,具体参数如下表。
- **name**: 超级表名,必须配置,没有默认值。
- **child_table_exists** : 子表是否已经存在,默认值为 "no",可选值为 "yes" 或 "no"
- **child_table_exists** : 子表是否已经存在,默认值为 "no",可选值为 "yes" 或 "no"
- **child_table_count** : 子表的数量,默认值为 10
- **child_table_count** : 子表的数量,默认值为 10
- **child_table_prefix** : 子表名称的前缀,必选配置项,没有默认值
- **child_table_prefix** : 子表名称的前缀,必选配置项,没有默认值
- **escape_character** : 超级表和子表名称中是否包含转义字符,默认值为 "no",可选值为 "yes" 或 "no"
- **escape_character** : 超级表和子表名称中是否包含转义字符,默认值为 "no",可选值为 "yes" 或 "no"
- **auto_create_table** : 仅当 insert_mode 为 taosc, rest, stmt 并且 childtable_exists 为 "no" 时生效,该参数为 "yes" 表示 taosBenchmark 在插入数据时会自动创建不存在的表;为 "no" 则表示先提前建好所有表再进行插入。
......@@ -478,7 +478,7 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
- **count** : 指定该类型列连续出现的数量,例如 "count": 4096 即可生成 4096 个指定类型的列。
- **name** : 列的名字,若与 count 同时使用,比如 "name":"current", "count":3, 则 3 个列的名字分别为 current, current_2. current_3
- **name** : 列的名字,若与 count 同时使用,比如 "name":"current", "count":3, 则 3 个列的名字分别为 current, current_2. current_3
- **min** : 数据类型的 列/标签 的最小值。
......@@ -516,68 +516,68 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
查询子表或者普通表的配置参数在 `specified_table_query` 中设置。
- **query_interval** : 查询时间间隔,单位是秒,默认值为 0
- **query_interval** : 查询时间间隔,单位是秒,默认值为 0
- **threads** : 执行查询 SQL 的线程数,默认值为 1
- **threads** : 执行查询 SQL 的线程数,默认值为 1
- **sqls**
- **sql**: 执行的 SQL 命令,必填
- **result**: 保存查询结果的文件,未指定则不保存
- **sql**: 执行的 SQL 命令,必填
- **result**: 保存查询结果的文件,未指定则不保存
#### 查询超级表的配置参数
查询超级表的配置参数在 `super_table_query` 中设置。
- **stblname** : 指定要查询的超级表的名称,必填
- **stblname** : 指定要查询的超级表的名称,必填
- **query_interval** : 查询时间间隔,单位是秒,默认值为 0
- **query_interval** : 查询时间间隔,单位是秒,默认值为 0
- **threads** : 执行查询 SQL 的线程数,默认值为 1
- **threads** : 执行查询 SQL 的线程数,默认值为 1
- **sqls**
- **sql** : 执行的 SQL 命令,必填;对于超级表的查询 SQL,在 SQL 命令中保留 "xxxx",程序会自动将其替换为超级表的所有子表名。
替换为超级表中所有的子表名。
- **result** : 保存查询结果的文件,未指定则不保存
- **result** : 保存查询结果的文件,未指定则不保存
### 订阅场景配置参数
查询场景下 `filetype` 必须设置为 `subscribe`,该参数及其它通用参数详见[通用配置参数](#通用配置参数)
订阅场景下 `filetype` 必须设置为 `subscribe`,该参数及其它通用参数详见[通用配置参数](#通用配置参数)
#### 执行指定订阅语句的配置参数
订阅子表或者普通表的配置参数在 `specified_table_query` 中设置。
- **threads** : 执行 SQL 的线程数,默认为 1
- **threads** : 执行 SQL 的线程数,默认为 1
- **interva** : 执行订阅的时间间隔,单位为秒,默认为 0
- **interva** : 执行订阅的时间间隔,单位为秒,默认为 0
- **restart** : "yes" 表示开始新的订阅,"no" 表示继续之前的订阅,默认值为 "no"
- **restart** : "yes" 表示开始新的订阅,"no" 表示继续之前的订阅,默认值为 "no"
- **keepProgress** : "yes" 表示保留订阅进度,"no" 表示不保留,默认值为 "no"
- **keepProgress** : "yes" 表示保留订阅进度,"no" 表示不保留,默认值为 "no"
- **resubAfterConsume** : "yes" 表示取消之前的订阅然后再次订阅, "no" 表示继续之前的订阅,默认值为 "no"
- **resubAfterConsume** : "yes" 表示取消之前的订阅然后再次订阅, "no" 表示继续之前的订阅,默认值为 "no"
- **sqls**
- **sql** : 执行的 SQL 命令,必填
- **result** : 保存查询结果的文件,未指定则不保存
- **sql** : 执行的 SQL 命令,必填
- **result** : 保存查询结果的文件,未指定则不保存
#### 订阅超级表的配置参数
订阅超级表的配置参数在 `super_table_query` 中设置。
- **stblname** : 要订阅的超级表名称,必填
- **stblname** : 要订阅的超级表名称,必填
- **threads** : 执行 SQL 的线程数,默认为 1
- **threads** : 执行 SQL 的线程数,默认为 1
- **interva** : 执行订阅的时间间隔,单位为秒,默认为 0
- **interva** : 执行订阅的时间间隔,单位为秒,默认为 0
- **restart** : "yes" 表示开始新的订阅,"no" 表示继续之前的订阅,默认值为 "no"
- **restart** : "yes" 表示开始新的订阅,"no" 表示继续之前的订阅,默认值为 "no"
- **keepProgress** : "yes" 表示保留订阅进度,"no" 表示不保留,默认值为 "no"
- **keepProgress** : "yes" 表示保留订阅进度,"no" 表示不保留,默认值为 "no"
- **resubAfterConsume** : "yes" 表示取消之前的订阅然后再次订阅, "no" 表示继续之前的订阅,默认值为 "no"
- **resubAfterConsume** : "yes" 表示取消之前的订阅然后再次订阅, "no" 表示继续之前的订阅,默认值为 "no"
- **sqls**
- **sql** : 执行的 SQL 命令,必填;对于超级表的查询 SQL,在 SQL 命令中保留 "xxxx",程序会自动将其替换为超级表的所有子表名。
替换为超级表中所有的子表名。
- **result** : 保存查询结果的文件,未指定则不保存
- **result** : 保存查询结果的文件,未指定则不保存
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册