From 549c5f9c9380dafb68d5be42ed05fbeadf9569d6 Mon Sep 17 00:00:00 2001 From: CbcWestwolf <1004626265@qq.com> Date: Fri, 14 Jul 2023 13:32:13 +0800 Subject: [PATCH] *: modify some deprecated configuration items (#14219) --- dashboard/dashboard-overview.md | 2 +- dashboard/dashboard-slow-query.md | 2 +- dynamic-config.md | 6 +++--- faq/deploy-and-maintain-faq.md | 2 +- quick-start-with-tidb.md | 2 +- tidb-configuration-file.md | 14 ++++++++++++++ 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/dashboard/dashboard-overview.md b/dashboard/dashboard-overview.md index 6ec04083a53a1..075c98fdf99a4 100644 --- a/dashboard/dashboard-overview.md +++ b/dashboard/dashboard-overview.md @@ -59,7 +59,7 @@ By default, this area shows the latest 10 slow queries in the entire cluster ove ![Recent slow queries](/media/dashboard/dashboard-overview-slow-query.png) -By default, the SQL query that is executed longer than 300 milliseconds is counted as a slow query and displayed on the table. You can change this threshold by modifying the [tidb_slow_log_threshold](/system-variables.md#tidb_slow_log_threshold) variable or the [slow-threshold](/tidb-configuration-file.md#slow-threshold) TiDB parameter. +By default, the SQL query that is executed longer than 300 milliseconds is counted as a slow query and displayed on the table. You can change this threshold by modifying the [tidb_slow_log_threshold](/system-variables.md#tidb_slow_log_threshold) variable or the [instance.tidb_slow_log_threshold](/tidb-configuration-file.md#tidb_slow_log_threshold) TiDB parameter. The content displayed in this area is consistent with the more detailed [Slow Queries Page](/dashboard/dashboard-slow-query.md). You can click the **Recent Slow Queries** title to view the complete list. For details of the columns in this table, see this [Slow Queries Page](/dashboard/dashboard-slow-query.md). diff --git a/dashboard/dashboard-slow-query.md b/dashboard/dashboard-slow-query.md index e06d091ab39db..25e72f0386e53 100644 --- a/dashboard/dashboard-slow-query.md +++ b/dashboard/dashboard-slow-query.md @@ -8,7 +8,7 @@ aliases: ['/docs/dev/dashboard/dashboard-slow-query/'] On the Slow Queries page of TiDB Dashboard, you can search and view all slow queries in the cluster. -By default, SQL queries with an execution time of more than 300 milliseconds are considered as slow queries. These queries are recorded in the [slow query logs](/identify-slow-queries.md) and can be searched via TiDB Dashboard. You can adjust the threshold of slow queries through the [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold) session variable or the [`slow-threshold`](/tidb-configuration-file.md#slow-threshold) TiDB parameter. +By default, SQL queries with an execution time of more than 300 milliseconds are considered as slow queries. These queries are recorded in the [slow query logs](/identify-slow-queries.md) and can be searched via TiDB Dashboard. You can adjust the threshold of slow queries through the [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold) session variable or the [`instance.tidb_slow_log_threshold`](/tidb-configuration-file.md#tidb_slow_log_threshold) TiDB parameter. > **Note:** > diff --git a/dynamic-config.md b/dynamic-config.md index 2279535e5d0ec..1c49cf808088d 100644 --- a/dynamic-config.md +++ b/dynamic-config.md @@ -335,9 +335,9 @@ The following TiDB configuration items can be modified dynamically: | Configuration item | SQL variable | Description | | :--- | :--- | -| `log.enable-slow-log` | `tidb_enable_slow_log` | Whether to enable slow log | -| `log.slow-threshold` | `tidb_slow_log_threshold` | The threshold of slow log | -| `log.expensive-threshold` | `tidb_expensive_query_time_threshold` | The threshold of a expensive query | +| `instance.tidb_enable_slow_log` | `tidb_enable_slow_log` | Whether to enable slow log | +| `instance.tidb_slow_log_threshold` | `tidb_slow_log_threshold` | The threshold of slow log | +| `instance.tidb_expensive_query_time_threshold` | `tidb_expensive_query_time_threshold` | The threshold of a expensive query | ### Modify TiFlash configuration dynamically diff --git a/faq/deploy-and-maintain-faq.md b/faq/deploy-and-maintain-faq.md index 7c791b42a9520..cf9577c84ec28 100644 --- a/faq/deploy-and-maintain-faq.md +++ b/faq/deploy-and-maintain-faq.md @@ -77,7 +77,7 @@ Check the time difference between the machine time of the monitor and the time w ### How to separately record the slow query log in TiDB? How to locate the slow query SQL statement? -1. The slow query definition for TiDB is in the TiDB configuration file. The `slow-threshold: 300` parameter is used to configure the threshold value of the slow query (unit: millisecond). +1. The slow query definition for TiDB is in the TiDB configuration file. The `tidb_slow_log_threshold: 300` parameter is used to configure the threshold value of the slow query (unit: millisecond). 2. If a slow query occurs, you can locate the `tidb-server` instance where the slow query is and the slow query time point using Grafana and find the SQL statement information recorded in the log on the corresponding node. diff --git a/quick-start-with-tidb.md b/quick-start-with-tidb.md index d5e3e15ff5c0b..96659f5a2e032 100644 --- a/quick-start-with-tidb.md +++ b/quick-start-with-tidb.md @@ -379,7 +379,7 @@ Other requirements for the target machine include: 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 diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index 74ba6c4bd7785..65d409f136c26 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -287,6 +287,10 @@ Configuration items related to log. ### `expensive-threshold` +> **Warning:** +> +> Starting from v5.4.0, the `expensive-threshold` configuration item is deprecated and replaced by the system variable [`tidb_expensive_query_time_threshold`](/system-variables.md#tidb_expensive_query_time_threshold). + - Outputs the threshold value of the number of rows for the `expensive` operation. - Default value: `10000` - When the number of query rows (including the intermediate results based on statistics) is larger than this value, it is an `expensive` operation and outputs log with the `[EXPENSIVE_QUERY]` prefix. @@ -831,6 +835,16 @@ Configuration items related to read isolation. - Unit: Milliseconds - Before v6.1.0, this configuration is set by `slow-threshold`. +### `tidb_expensive_query_time_threshold` + +- This configuration is used to set the threshold value that determines whether to print expensive query logs. The difference between expensive query logs and slow query logs is: + - Slow logs are printed after the statement is executed. + - Expensive query logs print the statements that are being executed, with execution time exceeding the threshold value, and their related information. +- Default value: `60` +- Range: `[10, 2147483647]` +- Unit: Seconds +- Before v5.4.0, this configuration is set by `expensive-threshold`. + ### `tidb_record_plan_in_slow_log` - This configuration is used to control whether to include the execution plan of slow queries in the slow log.