未验证 提交 6909a0f1 编写于 作者: W wade zhang 提交者: GitHub

Merge pull request #11762 from taosdata/docs/wade-20220422-taosbenchmark-2

docs: refine taosBenchmark page
...@@ -12,15 +12,15 @@ taosBenchmark (曾用名 taosdemo ) 是一个用于测试 TDengine 产品性能 ...@@ -12,15 +12,15 @@ taosBenchmark (曾用名 taosdemo ) 是一个用于测试 TDengine 产品性能
taosBenchmark 有两种安装方式: taosBenchmark 有两种安装方式:
- 安装 TDengine 官方安装包的同时会自动安装 taosBenchmark, 详情请参考[ TDengine 安装](#/get-started) - 安装 TDengine 官方安装包的同时会自动安装 taosBenchmark, 详情请参考[ TDengine 安装](/operation/pkg-install)
- 单独编译 taos-tools 并安装, 详情请参考 [taos-tools](#https://github.com/taosdata/taos-tools) 仓库。 - 单独编译 taos-tools 并安装, 详情请参考 [taos-tools](https://github.com/taosdata/taos-tools) 仓库。
## 运行 ## 运行
### 配置和运行方式 ### 配置和运行方式
taosBenchmark 支持两种配置方式:[命令行参数](#命令行参数)[JSON 配置文件](#json-配置文件)。这两种方式是互斥的,在使用配置文件时只能使用一个命令行参数 `-f <json file>` 指定配置文件。在使用命令行参数运行 taosBenchmark 并控制其行为时则不能使用 `-f` 参数而要用其它参数来进行配置。除此之外,taosBenchmark 还提供了一种特殊的运行方式,即无参数运行。 taosBenchmark 支持两种配置方式:[命令行参数](#命令行参数详解)[JSON 配置文件](#配置文件参数详解)。这两种方式是互斥的,在使用配置文件时只能使用一个命令行参数 `-f <json file>` 指定配置文件。在使用命令行参数运行 taosBenchmark 并控制其行为时则不能使用 `-f` 参数而要用其它参数来进行配置。除此之外,taosBenchmark 还提供了一种特殊的运行方式,即无参数运行。
taosBenchmark 支持对 TDengine 做完备的性能测试,其所支持的 TDengine 功能分为三大类:写入、查询和订阅。这三种功能之间是互斥的,每次运行 taosBenchmark 只能选择其中之一。值得注意的是,所要测试的功能类型在使用命令行配置方式时是不可配置的,命令行配置方式只能测试写入性能。若要测试 TDegnine 的查询和订阅性能,必须使用配置文件的方式,通过配置文件中的参数 `filetype` 指定所要测试的功能类型。 taosBenchmark 支持对 TDengine 做完备的性能测试,其所支持的 TDengine 功能分为三大类:写入、查询和订阅。这三种功能之间是互斥的,每次运行 taosBenchmark 只能选择其中之一。值得注意的是,所要测试的功能类型在使用命令行配置方式时是不可配置的,命令行配置方式只能测试写入性能。若要测试 TDegnine 的查询和订阅性能,必须使用配置文件的方式,通过配置文件中的参数 `filetype` 指定所要测试的功能类型。
...@@ -44,7 +44,7 @@ taosBenchmark ...@@ -44,7 +44,7 @@ taosBenchmark
taosBenchmark -I stmt -n 200 -t 100 taosBenchmark -I stmt -n 200 -t 100
``` ```
上面的命令 `taosBenchmark` 将创建一个数据库,一张超级表,建立 100 张子表并使用参数绑定的方式每张表插入 200 条记录 上面的命令 `taosBenchmark` 将创建一个名为`test`的数据库,在其中建立一张超级表`meters`,在该超级表中建立 100 张子表并使用参数绑定的方式为每张子表插入 200 条记录。
### 使用配置文件运行 ### 使用配置文件运行
...@@ -65,87 +65,87 @@ taosBenchmark -f <json file> ...@@ -65,87 +65,87 @@ taosBenchmark -f <json file>
```json ```json
{ {
"filetype": "insert", "filetype": "insert",
"cfgdir": "/etc/taos", "cfgdir": "/etc/taos",
"host": "127.0.0.1", "host": "127.0.0.1",
"port": 6030, "port": 6030,
"user": "root", "user": "root",
"password": "taosdata", "password": "taosdata",
"connection_pool_size": 8, "connection_pool_size": 8,
"thread_count": 4, "thread_count": 4,
"result_file": "./insert_res.txt", "result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no", "confirm_parameter_prompt": "no",
"insert_interval": 0, "insert_interval": 0,
"interlace_rows": 100, "interlace_rows": 100,
"num_of_records_per_req": 100, "num_of_records_per_req": 100,
"prepared_rand": 10000, "prepared_rand": 10000,
"chinese": "no", "chinese": "no",
"databases": [ "databases": [
{ {
"dbinfo": { "dbinfo": {
"name": "db", "name": "db",
"drop": "yes", "drop": "yes",
"replica": 1, "replica": 1,
"days": 10, "days": 10,
"cache": 16, "cache": 16,
"blocks": 8, "blocks": 8,
"precision": "ms", "precision": "ms",
"keep": 3650, "keep": 3650,
"minRows": 100, "minRows": 100,
"maxRows": 4096, "maxRows": 4096,
"comp": 2, "comp": 2,
"walLevel": 1, "walLevel": 1,
"cachelast": 0, "cachelast": 0,
"quorum": 1, "quorum": 1,
"fsync": 3000, "fsync": 3000,
"update": 0 "update": 0
}, },
"super_tables": [ "super_tables": [
{ {
"name": "stb", "name": "stb",
"child_table_exists": "no", "child_table_exists": "no",
"childtable_count": 100, "childtable_count": 100,
"childtable_prefix": "stb_", "childtable_prefix": "stb_",
"escape_character": "yes", "escape_character": "yes",
"auto_create_table": "no", "auto_create_table": "no",
"batch_create_tbl_num": 5, "batch_create_tbl_num": 5,
"data_source": "rand", "data_source": "rand",
"insert_mode": "taosc", "insert_mode": "taosc",
"non_stop_mode": "no", "non_stop_mode": "no",
"line_protocol": "line", "line_protocol": "line",
"insert_rows": 100000, "insert_rows": 100000,
"childtable_limit": 10, "childtable_limit": 10,
"childtable_offset": 100, "childtable_offset": 100,
"interlace_rows": 0, "interlace_rows": 0,
"insert_interval": 0, "insert_interval": 0,
"partial_col_num": 0, "partial_col_num": 0,
"disorder_ratio": 0, "disorder_ratio": 0,
"disorder_range": 1000, "disorder_range": 1000,
"timestamp_step": 10, "timestamp_step": 10,
"start_timestamp": "2020-10-01 00:00:00.000", "start_timestamp": "2020-10-01 00:00:00.000",
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"use_sample_ts": "no", "use_sample_ts": "no",
"tags_file": "", "tags_file": "",
"columns": [ "columns": [
{ "type": "INT", "name": "id" }, { "type": "INT", "name": "id" },
{ "type": "DOUBLE", "count": 10 }, { "type": "DOUBLE", "count": 10 },
{ "type": "BINARY", "len": 16, "count": 3 }, { "type": "BINARY", "len": 16, "count": 3 },
{ "type": "BINARY", "len": 32, "count": 6 } { "type": "BINARY", "len": 32, "count": 6 }
], ],
"tags": [ "tags": [
{ "type": "TINYINT", "count": 2, "max": 10, "min": 98 }, { "type": "TINYINT", "count": 2, "max": 10, "min": 98 },
{ {
"type": "BINARY", "type": "BINARY",
"len": 16, "len": 16,
"count": 5, "count": 5,
"values": ["beijing", "shanghai"] "values": ["beijing", "shanghai"]
} }
] ]
} }
] ]
} }
] ]
} }
``` ```
...@@ -158,41 +158,41 @@ taosBenchmark -f <json file> ...@@ -158,41 +158,41 @@ taosBenchmark -f <json file>
```json ```json
{ {
"filetype": "query", "filetype": "query",
"cfgdir": "/etc/taos", "cfgdir": "/etc/taos",
"host": "127.0.0.1", "host": "127.0.0.1",
"port": 6030, "port": 6030,
"user": "root", "user": "root",
"password": "taosdata", "password": "taosdata",
"confirm_parameter_prompt": "no", "confirm_parameter_prompt": "no",
"databases": "db", "databases": "db",
"query_times": 2, "query_times": 2,
"query_mode": "taosc", "query_mode": "taosc",
"specified_table_query": { "specified_table_query": {
"query_interval": 1, "query_interval": 1,
"concurrent": 3, "concurrent": 3,
"sqls": [ "sqls": [
{ {
"sql": "select last_row(*) from stb0 ", "sql": "select last_row(*) from stb0 ",
"result": "./query_res0.txt" "result": "./query_res0.txt"
}, },
{ {
"sql": "select count(*) from stb00_1", "sql": "select count(*) from stb00_1",
"result": "./query_res1.txt" "result": "./query_res1.txt"
} }
] ]
}, },
"super_table_query": { "super_table_query": {
"stblname": "stb1", "stblname": "stb1",
"query_interval": 1, "query_interval": 1,
"threads": 3, "threads": 3,
"sqls": [ "sqls": [
{ {
"sql": "select last_row(ts) from xxxx", "sql": "select last_row(ts) from xxxx",
"result": "./query_res2.txt" "result": "./query_res2.txt"
} }
] ]
} }
} }
``` ```
...@@ -205,39 +205,39 @@ taosBenchmark -f <json file> ...@@ -205,39 +205,39 @@ taosBenchmark -f <json file>
```json ```json
{ {
"filetype": "subscribe", "filetype": "subscribe",
"cfgdir": "/etc/taos", "cfgdir": "/etc/taos",
"host": "127.0.0.1", "host": "127.0.0.1",
"port": 6030, "port": 6030,
"user": "root", "user": "root",
"password": "taosdata", "password": "taosdata",
"databases": "db", "databases": "db",
"confirm_parameter_prompt": "no", "confirm_parameter_prompt": "no",
"specified_table_query": { "specified_table_query": {
"concurrent": 1, "concurrent": 1,
"interval": 0, "interval": 0,
"restart": "yes", "restart": "yes",
"keepProgress": "yes", "keepProgress": "yes",
"sqls": [ "sqls": [
{ {
"sql": "select * from stb00_0 ;", "sql": "select * from stb00_0 ;",
"result": "./subscribe_res0.txt" "result": "./subscribe_res0.txt"
} }
] ]
}, },
"super_table_query": { "super_table_query": {
"stblname": "stb0", "stblname": "stb0",
"threads": 1, "threads": 1,
"interval": 10000, "interval": 10000,
"restart": "yes", "restart": "yes",
"keepProgress": "yes", "keepProgress": "yes",
"sqls": [ "sqls": [
{ {
"sql": "select * from xxxx where ts > '2021-02-25 11:35:00.000' ;", "sql": "select * from xxxx where ts > '2021-02-25 11:35:00.000' ;",
"result": "./subscribe_res1.txt" "result": "./subscribe_res1.txt"
} }
] ]
} }
} }
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册