diff --git a/docs-cn/14-reference/05-taosbenchmark.md b/docs-cn/14-reference/05-taosbenchmark.md index c6c4b09b86ae06334cb0b36c65024af07d500621..11e6b3d122b70e87f9d8d1864a1fb8422dccb450 100644 --- a/docs-cn/14-reference/05-taosbenchmark.md +++ b/docs-cn/14-reference/05-taosbenchmark.md @@ -10,39 +10,40 @@ taosBenchmark (曾用名 taosdemo ) 是一个用于测试 TDengine 产品性能 taosBenchmark 支持两种配置方式:[命令行参数](#cli) 和 [JSON 配置文件](#json)。 ## 命令行参数 +下表列出了命令行参数及简要描述,详细解释请参考 #配置参数详解 | 选项名称 | 描述 | | :--------------------------------------- | --------------------------------------------------------- | -| [-f/--file](#json) | JSON 配置文件, 与命令行其他参数不能同时使用 | -| -c/--config-dir | 配置文件所在的目录,默认路径是 /etc/taos/ | -| -h/--host | 用于连接 taosd 服务器的 FQDN,默认值为 localhost。 | -| -P/--port | 用于连接 taosd 服务器的端口号,默认值为 6030。 | -| [-I/--interface](#insert-mode) | taosBenchmark 如何插入数据,默认值为 taosc。 | -| -u/--user | 用于连接 taosd 服务器的用户名,默认值为 root。 | -| -p/--password | 用于连接 taosd 服务器的密码,默认值为 taosdata。 | +| [-f/--file](#json) | 使用JSON 配置文件指定所有参数, 与命令行其他参数不能同时使用 | +| -c/--config-dir | TDengine 集群配置文件所在的目录,默认路径是 /etc/taos/ | +| -h/--host | 要连接 TDengine 服务端的 FQDN,默认值为 localhost。 | +| -P/--port | 要连接的 TDengine 服务器的端口号,默认值为 6030。 | +| [-I/--interface](#insert-mode) | 数据插入模式,默认值为 taosc。 | +| -u/--user | 用于连接 TDengine 服务端的用户名,默认值为 root。 | +| -p/--password | 用于连接 TDengine 服务端的密码,默认值为 taosdata。 | | -o/--output | 指定结果输出文件的路径,默认值为 ./output.txt。 | | -T/--thread | 指定插入数据的线程数,默认值为 8 | -| [-i/--insert-interval](#insert-interval) | 隔行插入模式的插入间隔,单位为 ms,默认值为 0。 | -| -S/--timestampstep | 每个子表中每条记录的插入时间戳步长,单位是 ms,默认值是 1 | -| [-B/--interlace-rows](#interlace-rows) | 向子表插入交错行的数量 | -| [-r/--rec-per-req](#record-per-request) | 每次插入请求的记录数,默认值为 30000 | +| [-i/--insert-interval](#insert-interval) | 交错插入模式的插入间隔,单位为 ms,默认值为 0。 | +| -S/--timestampstep | 每个子表中插入数据的时间戳步长,单位是 ms,默认值是 1 | +| [-B/--interlace-rows](#interlace-rows) | 交错插入模式下向每个子表每次插入的数据行数 | +| [-r/--rec-per-req](#record-per-request) | 每次向 TDengine 服务端请求插入的记录数,默认值为 30000 | | -t/--tables | 子表的数量,默认值为 10000。 | | -n/--records | 每个子表插入的记录数,默认值为 10000。 | | -d/--database | 数据库的名称,默认值为 test。 | -| [-l/--columns](#columns) | 子表的列数,将使用 int 数据类型的列。 | -| [-A/--tag-type](#tag-type) | 子表的标签的数据类型。 | -| [-b/--data-type](#data-type) | 子表的列的数据类型 | -| -w/--binwidth | 调整 nchar 和 binary 数据类型的默认长度,默认值为 64。 | +| [-l/--columns](#columns) | 超级表的数据列数 | 。 | +| [-A/--tag-type](#tag-type) | 超级表的标签列的数据类型。 | +| [-b/--data-type](#data-type) | 超级表的数据列的数据类型 | +| -w/--binwidth | nchar 和 binary 数据类型的默认长度,默认值为 64。 | | -m/--table-prefix | 子表名称的前缀,默认值为 d | | -E/--escape-character | 在超级表和子表名称中使用转义字符,可选。 | | -C/--chinese | nchar 和 binary 是否基本的 Unicode 中文字符,可选。 | | [-N/--normal-table](#normal-table) | 只创建普通表,不创建超级表,可选。 | -| [-M/--random](#random) | 数据源否使用随机的,可选。 | +| [-M/--random](#random) | 插入数据为随机值,可选。 | | -x/--aggr-func | 插入后查询聚合函数,可选。 | | -y/--answer-yes | 通过确认提示继续,可选。 | | [-R/--disorder-range](#disorder-range) | 失序时间戳的范围,基于数据库的精度,默认值为 1000 | -| [-O/--disorder](#disorder-ratio) | 插入无序时间戳的数据的概率,默认为 0。 | -| [-F/--prepare_rand](#prepared-rand) | 生产随机数据的随机个数,默认为 10000 | +| [-O/--disorder](#disorder-ratio) | 插入无序时间戳的数据的百分比,默认为 0。 | +| [-F/--prepare_rand](#prepared-rand) | 生成随机数据的随机个数,默认为 10000 | | -a/--replica | 创建数据库时的副本数量,默认值为 1。 | | -V/--version | 显示版本信息并退出 | | -?/--help | 显示帮助信息并退出。 | @@ -141,24 +142,24 @@ taosBenchmark 支持两种配置方式:[命令行参数](#cli) 和 [JSON 配 | 组 | 选项名称 | 描述 | | ------------ | --------------------------------------------- | ----------------------------------------------------------------------------------------- | | | filetype | 文件类型,指定哪种测试,对于插入测试,需要为 insert。 | -| | cfgdir | taosd 配置文件所在的目录,默认值是 /etc/taos。 | -| | host | taosd 服务器的 FQDN,默认为 localhost。 | -| | port | taosd 服务器的端口号,默认为 6030。 | -| | user | 连接 taosd 服务器的用户名,默认为 root。 | -| | password | 连接 taosd 服务器的密码,默认为 taosdata。 | -| | [connection_pool_size](#connection-pool-size) | taos 连接池的大小,默认为线程数。 | +| | cfgdir | TDengine集群配置文件所在的目录,默认值是 /etc/taos。 | +| | host | TDengine 服务端的 FQDN,默认为 localhost。 | +| | port | TDengine 服务器的端口号,默认为 6030。 | +| | user | 连接 TDengine 服务端的用户名,默认为 root。 | +| | password | 连接 TDengine 服务端的密码,默认为 taosdata。 | +| | [connection_pool_size](#connection-pool-size) | 客户端连接池的大小,默认为指定的插入线程数。 | | | thread_count | 插入和创建表的线程数,默认为 8。 | | | result_file | 保存输出结果的文件路径,默认为 ./output.txt。 | | | confirm_parameter_prompt | 在执行过程中传递确认提示,默认为无。 | -| | [insert_interval](#insert-interval) | 插入隔行扫描模式的间隔时间,默认值为 0 | -| | [interlace_rows](#interlace-rows) | 每个子表的交错行数,默认值为 0。 | -| | [num_of_records_per_req](#record-per-request) | 每个请求中的记录数,默认值为 30000。 | +| | [insert_interval](#insert-interval) | 交错插入模式的间隔时间,默认值为 0 | +| | [interlace_rows](#interlace-rows) | 每个子表的交错插入行数,默认值为 0。 | +| | [num_of_records_per_req](#record-per-request) | 每个插入请求中的记录数,默认值为 30000。 | | | [prepare_rand](#prepared-rand) | 随机产生的数据数量,默认值为 10000 | -| | chinese | nchar 和 binary 都是 rand 中文,默认值为否。 | +| | chinese | nchar 和 binary 都是随机中文字符串,默认值为否。 | | dbinfo | name | 数据库名称,必填 | | dbinfo | drop | 插入测试前是否删除数据库,默认值为是。 | -| dbinfo | replica | 复制的数量,默认值是 1。 | -| dbinfo | days | 在文件中存储数据的时间跨度,默认值为 10。 | +| dbinfo | replica | 数据库副本的数量,默认值是 1。 | +| dbinfo | days | 单个数据文件中存储数据的时间跨度,默认值为 10。 | | dbinfo | cache | 内存块的大小,单位是 MB,默认值是 16。 | | dbinfo | blocks | 每个 vnode(tsdb) 中的缓存大小的内存块的数量,默认值为 6。 | | dbinfo | precision | 数据库时间精度,默认值为 "ms"。 | @@ -184,14 +185,14 @@ taosBenchmark 支持两种配置方式:[命令行参数](#cli) 和 [JSON 配 | super_tables | [line_protocol](#line-protocol) | 行协议,可选项:line, telnet, json, 默认为 line。 | | super_tables | [tcp_transfer](#tcp-transfer) | 使用 tcp 还是 http 协议,默认为 http。 | | super_tables | insert_rows | 每个子表的记录数,默认为 0。 | -| super_tables | [childtable_offset](#childtable-offset) | 子表的偏移量。 | +| super_tables | [childtable_offset](#childtable-offset) | 获取子表列表时的偏移量量。 | | super_tables | [childtable_limit](#childtable-limit) | 插入数据的子表数量。 | -| super_tables | [interlace_rows](#interlace-rows) | 每个子表的间隔行,默认为 0。 | -| super_tables | [insert_interval](#insert-interval) | 两个请求之间的插入时间间隔,当 interlace_rows 大于 0 时有效。 | -| super_tables | [partial_col_num](#partial-col-num) | 指定仅向前多少列写入,默认为 0。 | -| super_tables | [disorder_ratio](#disorder-ratio) | 紊乱时间戳的数据比例,默认为 0 | -| super_tables | [disorder_range](#disorder-range) | 无序时间戳的范围,只有当 disorder_ratio 大于 0 时才有效,默认为 1000。 | -| super_tables | timestamp_step | 每条记录的时间戳步骤,默认为 1。 | +| super_tables | [interlace_rows](#interlace-rows) | 交错插入模式下每个子表每次插入的数据行数,默认为 0。 | +| super_tables | [insert_interval](#insert-interval) | 交错插入模式下两次插入的时间间隔,当 interlace_rows 大于 0 时有效。 | +| super_tables | [partial_col_num](#partial-col-num) | 指定仅向前多少列写入数据,默认为 0。 | +| super_tables | [disorder_ratio](#disorder-ratio) | 乱序时间戳的数据比例,默认为 0 | +| super_tables | [disorder_range](#disorder-range) | 无序时间戳的回退范围,只有当 disorder_ratio 大于 0 时才有效,默认为 1000。 | +| super_tables | timestamp_step | 每条记录的时间戳步长,默认为 1。 | | super_tables | start_timestamp | 每个子表的时间戳起始值,默认值是 now。 | | super_tables | sample_format | 样本数据文件的类型,现在只支持 csv。 | | super_tables | [sample_file](#sample-file) | 样本文件,仅当 data_source 为 "sample "时有效。 | @@ -199,11 +200,11 @@ taosBenchmark 支持两种配置方式:[命令行参数](#cli) 和 [JSON 配 | super_tables | [tags_file](#tags-file) | 原理与[sample_file](#sample-file)相同,标签数据样本文件,仅支持 taosc、rest insert 模式。 | | columns/tags | [type](#type) | 数据类型,必填 | | columns/tags | [len](#len) | 数据长度,默认为 8。 | -| columns/tags | [count](#count) | 该列的连续数,默认为 1。 | -| columns/tags | [name](#name) | 这一列的名称,连续的列名将是 name\_#{number}。 | -| columns/tags | min | 数字数据类型列/标签的最小值 | -| columns/tags | max | 数字数据类型列/标签的最大值 | -| columns/tags | values | nchar/binary 列/标签的值,将从值中随机选择。 | +| columns/tags | [count](#count) | 该类型列连续出现的数量,默认为 1。 | +| columns/tags | [name](#name) | 该的名称,连续的列名将是 name\_#{number}。 | +| columns/tags | min | 数字数据类型的 列/标签 的最小值值 | +| columns/tags | max | 数字数据类型的 列/标签 的最大值值 | +| columns/tags | values | nchar/binary 列/标签的值域,将从值中随机选择。 | ### json 配置文件 (查询场景) @@ -251,20 +252,20 @@ taosBenchmark 支持两种配置方式:[命令行参数](#cli) 和 [JSON 配 | 组 | 选项 | 描述 | | --------------------------------------- | ------------------------ | --------------------------------------------- | ------------ | -| | filetype | 文件类型,指定哪种测试,对于查询测试,需要 | -| | cfgdir | taosd 配置文件所在的目录。 | -| | host | taosd 服务器的 FQDN,默认为 localhost。 | -| | port | taosd 服务器的端口号,默认为 6030。 | -| | user | 连接 taosd 服务器的用户名,默认为 root。 | -| | password | 连接 taosd 服务器的密码,默认为 taosdata。 | +| | filetype | 文件类型,指定哪种测试,对于查询测试,需要指定为query | +| | cfgdir | TDengine 集群配置文件所在的目录。 | +| | host | TDengine 服务端的 FQDN,默认为 localhost。 | +| | port | TDengine 服务端的端口号,默认为 6030。 | +| | user | 连接 TDengine 服务端的用户名,默认为 root。 | +| | password | 连接 TDengine 服务端的密码,默认为 taosdata。 | | | confirm_parameter_prompt | 在执行过程中传递确认提示,默认为否。 | -| | database | 数据库的名称,需要 | +| | database | 数据库的名称,必填 | | | query_times | 查询次数 | | | query mode | 查询模式,选项:taosc 和 rest,默认为 taosc。 | | specified_table_query/super_table_query | query_interval | 查询时间间隔,单位是秒,默认是 0 | | specified_table_query/super_table_query | concurrent/threads | 执行 SQL 的线程数,默认为 1。 | -| super_table_query | stblname | supertable name, required | 超级表名称。 | -| sqls | [sql](#sql) | SQL 命令,必填 | +| super_table_query | stblname | 超级表名称, 必填 | +| sqls | [sql](#sql) | 执行的 SQL 命令,必填 | | sqls | result | 查询结果的结果文件,没有则为空。 | ### json 配置文件 (订阅场景) @@ -311,12 +312,12 @@ taosBenchmark 支持两种配置方式:[命令行参数](#cli) 和 [JSON 配 | 组 | 选项 | 描述 | | --------------------------------------- | ------------------------ | ------------------------------------------ | -| | filetype | 文件类型,指定哪种测试,对于订阅测试,需要 | -| | cfgdir | taosd 配置文件的目录。 | -| | host | taosd 服务器的 FQDN,默认为 localhost。 | -| | port | taosd 服务器的端口号,默认为 6030。 | -| | user | 连接 taosd 服务器的用户名,默认为 root。 | -| | password | 连接 taosd 服务器的密码,默认为 taosdata。 | +| | filetype | 文件类型,指定哪种测试,对于订阅测试,需设置为 subscribe | +| | cfgdir | TDengine 集群配置文件的目录。 | +| | host | TDengine 服务端的 FQDN,默认为 localhost。 | +| | port | TDengine 服务端的端口号,默认为 6030。 | +| | user | TDengine 服务端的用户名,默认为 root。 | +| | password | TDengine 服务端的密码,默认为 taosdata。 | | | databases | 数据库名称,需要 | | | confirm_parameter_prompt | 在执行过程中是否通过确认提示。 | | specified_table_query/super_table_query | concurrent/threads | 执行 SQL 的线程数,默认为 1。 | @@ -324,8 +325,8 @@ taosBenchmark 支持两种配置方式:[命令行参数](#cli) 和 [JSON 配 | specified_table_query/super_table_query | restart | no: 继续之前的订阅,yes: 开始新的订阅。 | | specified_table_query/super_table_query | keepProgress | 是否保留订阅的进度。 | | specified_table_query/super_table_query | resubAfterConsume | 是否取消订阅,然后再次订阅? | -| super_table_query | stblname | supertable 的名称,必须的。 | -| sqls | [sql](#sql) | SQL 命令,必填 | +| super_table_query | stblname | 超级表 的名称,必填 | +| sqls | [sql](#sql) | 执行的 SQL 命令,必填 | | sqls | result | 查询结果的结果文件,没有则为空。 | ## 参数详解 @@ -387,7 +388,7 @@ taosBenchmark 支持两种配置方式:[命令行参数](#cli) 和 [JSON 配 ### random - 默认情况下生成的数据是模拟电表的数据采集点,数据值有特定的大小范围。若配置次参数,生成的数据为随机的 32 位整数,其范围为 [-21474836482,147483647]。**若有修改表结构的其他参数,如 [-l](#columns), [-b](#data-type), [-A](#tag-type)等...,将自动使用从支持最大的正负 32 位整数内随机产生的数据。** + 若配置次参数,则随机生成要插入的数据。对于数值类型的 标签列/数据列,其值为该类型取值范围内的随机值。对于 NCHAR 和 BINARY 类型的 标签列/数据列,其值为指定长度范围内的随机字符串。 ### disorder ratio