Skip to content

Commit

Permalink
*: modify some deprecated configuration items (#14481) (#14499)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot committed Jul 13, 2023
1 parent 60fe26f commit 626c3f0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dashboard/dashboard-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ title: TiDB Dashboard 概况页面

![界面](/media/dashboard/dashboard-overview-slow-query.png)

默认情况下运行时间超过 300ms 的 SQL 查询即会被计为慢查询并显示在该表格中。可通过调整 [tidb_slow_log_threshold](/system-variables.md#tidb_slow_log_threshold) 变量或 TiDB [slow-threshold](/tidb-configuration-file.md#slow-threshold) 参数调整阈值。
默认情况下运行时间超过 300ms 的 SQL 查询即会被计为慢查询并显示在该表格中。可通过调整 [tidb_slow_log_threshold](/system-variables.md#tidb_slow_log_threshold) 变量或 TiDB [instance.tidb_slow_log_threshold](/tidb-configuration-file.md#tidb_slow_log_threshold) 参数调整阈值。

该区域显示的内容与[慢查询页面](/dashboard/dashboard-slow-query.md)一致,可点击**最近的慢查询** (Recent Slow Queries) 标题查看完整列表。关于该表格中各列详情,见[慢查询页面](/dashboard/dashboard-slow-query.md)

Expand Down
2 changes: 1 addition & 1 deletion dashboard/dashboard-slow-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ summary: 了解如何在 TiDB Dashboard 中查看慢查询。

该页面上能检索和查看集群中所有慢查询。

默认情况下,执行时间超过 300ms 的 SQL 查询就会被视为慢查询,被记录到[慢查询日志](/identify-slow-queries.md)中,并可通过本功能对记录到的慢查询进行查询。可调整 [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold) SESSION 变量或 TiDB [`slow-threshold`](/tidb-configuration-file.md#slow-threshold) 参数调整慢查询阈值。
默认情况下,执行时间超过 300ms 的 SQL 查询就会被视为慢查询,被记录到[慢查询日志](/identify-slow-queries.md)中,并可通过本功能对记录到的慢查询进行查询。可调整 [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold) SESSION 变量或 TiDB [`instance.tidb_slow_log_threshold`](/tidb-configuration-file.md#tidb_slow_log_threshold) 参数调整慢查询阈值。

> **注意:**
>
Expand Down
6 changes: 3 additions & 3 deletions dynamic-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ select @@tidb_slow_log_threshold;

| 配置项 | 对应变量 | 简介 |
| --- | --- | --- |
| log.enable-slow-log | tidb_enable_slow_log | 慢日志的开关 |
| log.slow-threshold | tidb_slow_log_threshold | 慢日志阈值 |
| log.expensive-threshold | tidb_expensive_query_time_threshold | expensive 查询阈值 |
| instance.tidb_enable_slow_log | tidb_enable_slow_log | 慢日志的开关 |
| instance.tidb_slow_log_threshold | tidb_slow_log_threshold | 慢日志阈值 |
| instance.tidb_expensive_query_time_threshold | tidb_expensive_query_time_threshold | expensive 查询阈值 |

### 在线修改 TiFlash 配置

Expand Down
2 changes: 1 addition & 1 deletion faq/deploy-and-maintain-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ TiDB 支持部署和运行在 Intel x86-64 架构的 64 位通用硬件服务器

### 如何单独记录 TiDB 中的慢查询日志,如何定位慢查询 SQL?

1. TiDB 中,对慢查询的定义在 TiDB 的配置文件中。`slow-threshold: 300`,这个参数是配置慢查询记录阈值的,单位是 ms。
1. TiDB 中,对慢查询的定义在 TiDB 的配置文件中。`tidb_slow_log_threshold: 300`,这个参数是配置慢查询记录阈值的,单位是 ms。

2. 如果出现了慢查询,可以从 Grafana 监控定位到出现慢查询的 tidb-server 以及时间点,然后在对应节点查找日志中记录的 SQL 信息。

Expand Down
2 changes: 1 addition & 1 deletion quick-start-with-tidb.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ TiDB 是一个分布式系统。最基础的 TiDB 测试集群通常由 2 个 Ti

server_configs:
tidb:
log.slow-threshold: 300
instance.tidb_slow_log_threshold: 300
tikv:
readpool.storage.use-unified-pool: false
readpool.coprocessor.use-unified-pool: true
Expand Down
12 changes: 12 additions & 0 deletions tidb-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ TiDB 配置文件比命令行参数支持更多的选项。你可以在 [config/

### `expensive-threshold`

> **警告:**
>
> 自 v5.4.0 起,该配置项被废弃。请使用 [`tidb_expensive_query_time_threshold`](/system-variables.md#tidb_expensive_query_time_threshold) 系统变量进行设置。
+ 输出 `expensive` 操作的行数阈值。
+ 默认值:10000
+ 当查询的行数(包括中间结果,基于统计信息)大于这个值,该操作会被认为是 `expensive` 查询,并输出一个前缀带有 `[EXPENSIVE_QUERY]` 的日志。
Expand Down Expand Up @@ -828,6 +832,14 @@ TiDB 服务状态相关配置。
+ 当查询大于这个值,就会当做是一个慢查询,输出到慢查询日志。
+ 在 v6.1.0 之前,该功能通过配置项 `slow-threshold` 进行设置。

### `tidb_expensive_query_time_threshold`

+ 控制打印 expensive query 日志的阈值时间,默认值是 60 秒。expensive query 日志和慢日志的差别是,慢日志是在语句执行完后才打印,expensive query 日志可以把正在执行中且执行时间超过该阈值的语句及其相关信息打印出来。
+ 默认值:60
+ 范围:`[10, 2147483647]`
+ 单位:秒
+ 在 v5.4.0 之前,该功能通过配置项 `expensive-threshold` 进行设置。

### `tidb_record_plan_in_slow_log`

+ 在慢日志中记录执行计划。
Expand Down

0 comments on commit 626c3f0

Please sign in to comment.