Skip to content

Commit

Permalink
*: modify some deprecated configuration items (#14219)
Browse files Browse the repository at this point in the history
  • Loading branch information
CbcWestwolf authored Jul 14, 2023
1 parent 40f7479 commit 549c5f9
Show file tree
Hide file tree
Showing 6 changed files with 21 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 @@ -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).

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 @@ -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:**
>
Expand Down
6 changes: 3 additions & 3 deletions dynamic-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

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 @@ 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.

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 @@ -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
Expand Down
14 changes: 14 additions & 0 deletions tidb-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 549c5f9

Please sign in to comment.