Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: Add resource management topic and split docs #20010

Merged
merged 27 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7374391
*: Add resource management topic and split docs
nolouch Jan 15, 2025
ef39b08
update
nolouch Jan 15, 2025
fa06931
update
nolouch Jan 15, 2025
8ef4b25
Update tidb-resource-control-ru-groups.md
hfxsd Feb 7, 2025
07e0f33
Update TOC.md
nolouch Feb 7, 2025
2615167
Update faq/sql-faq.md
nolouch Feb 7, 2025
359f834
Update functions-and-operators/tidb-functions.md
nolouch Feb 7, 2025
b15c9ee
Update information-schema/information-schema-resource-groups.md
nolouch Feb 7, 2025
8dc8eee
Update tidb-resource-control-background-tasks.md
nolouch Feb 7, 2025
1d4095a
Update tidb-resource-control-background-tasks.md
nolouch Feb 7, 2025
5595fcd
Update tidb-resource-control-ru-groups.md
nolouch Feb 7, 2025
cbbf7f1
Update tidb-resource-control-ru-groups.md
nolouch Feb 7, 2025
3e43c49
Update tidb-resource-control-ru-groups.md
nolouch Feb 7, 2025
1c3d33f
Update tidb-resource-control-runaway-queries.md
nolouch Feb 7, 2025
0afdc6a
Update tidb-resource-control-runaway-queries.md
nolouch Feb 7, 2025
9e9f9bc
Update tiflash/tiflash-pipeline-model.md
nolouch Feb 7, 2025
cee61e3
Update tidb-resource-control-runaway-queries.md
nolouch Feb 7, 2025
45f9886
Update tikv-configuration-file.md
nolouch Feb 7, 2025
35ed4ae
Update user-account-management.md
nolouch Feb 7, 2025
b434893
Update functions-and-operators/tidb-functions.md
nolouch Feb 7, 2025
e3bfb1d
Merge remote-tracking branch 'upstream/master' into pr/20010
hfxsd Feb 7, 2025
49272ee
Merge branch 'split-docs' of https://github.com/nolouch/docs into pr/…
hfxsd Feb 7, 2025
34f09a8
Update system-variable-reference.md
hfxsd Feb 7, 2025
dbcbd7a
Update system-variable-reference.md
hfxsd Feb 7, 2025
1a7a01a
Update TOC-tidb-cloud.md
hfxsd Feb 7, 2025
8b6a84b
Update sql-statement-calibrate-resource.md
hfxsd Feb 7, 2025
58e8050
Apply suggestions from code review
hfxsd Feb 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@
- [Primary-Secondary DR](/dr-secondary-cluster.md)
- [Multi-Replica Cluster DR](/dr-multi-replica.md)
- [BR-based DR](/dr-backup-restore.md)
- [Resource Control](/tidb-resource-control.md)
- Resource Manager
- [Achieve resource group limitation and flow control using Resource Control](/tidb-resource-control.md)
- [Runaway Queries with resource consumption exceeding expectations](/tidb-resource-control-runaway-queries.md)
- [Limit background task resource usage](/tidb-resource-control-background-tasks.md)
- [Configure Time Zone](/configure-time-zone.md)
- [Daily Checklist](/daily-check.md)
- [Maintain TiFlash](/tiflash/maintain-tiflash.md)
Expand Down
4 changes: 2 additions & 2 deletions basic-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ You can try out TiDB features on [TiDB Playground](https://play.tidbcloud.com/?u
| [Cross-cluster RawKV replication](/tikv-configuration-file.md#api-version-new-in-v610) | E | E | E | E | E | N | N | N | N | N |
| [Green GC](/system-variables.md#tidb_gc_scan_lock_mode-new-in-v50) | E | E | E | E | E | E | E | E | E | E |
| [Resource control](/tidb-resource-control.md) | Y | Y | Y | Y | N | N | N | N | N | N |
nolouch marked this conversation as resolved.
Show resolved Hide resolved
| [Runaway Queries management](/tidb-resource-control.md#manage-queries-that-consume-more-resources-than-expected-runaway-queries) | Y | Y | E | N | N | N | N | N | N | N |
| [Background tasks management](/tidb-resource-control.md#manage-background-tasks) | E | E | E | N | N | N | N | N | N | N |
| [Runaway Queries management](/tidb-resource-control-runaway-queries.md) | Y | Y | E | N | N | N | N | N | N | N |
| [Background tasks management](/tidb-resource-control-background-tasks.md) | E | E | E | N | N | N | N | N | N | N |
| [TiFlash Disaggregated Storage and Compute Architecture and S3 Support](/tiflash/tiflash-disaggregated-and-s3.md) | Y | Y | Y | E | N | N | N | N | N | N |
| [Selecting TiDB nodes for the Distributed eXecution Framework (DXF) tasks](/system-variables.md#tidb_service_scope-new-in-v740) | Y | Y | N | N | N | N | N | N | N |
| PD Follower Proxy (controlled by [`tidb_enable_tso_follower_proxy`](/system-variables.md#tidb_enable_tso_follower_proxy-new-in-v530)) | Y | Y | Y | Y | Y | Y | Y | Y | N | N |
Expand Down
4 changes: 2 additions & 2 deletions error-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,11 +508,11 @@ TiDB is compatible with the error codes in MySQL, and in most cases returns the

* Error Number: 8253

The query stops because it meets the condition of a runaway query. See [Runaway Queries](/tidb-resource-control.md#manage-queries-that-consume-more-resources-than-expected-runaway-queries).
The query stops because it meets the condition of a runaway query. See [Runaway Queries](/tidb-resource-control-runaway-queries.md).

* Error Number: 8254

The query stops because it meets the quarantined watch condition of a runaway query. See [Runaway Queries](/tidb-resource-control.md#manage-queries-that-consume-more-resources-than-expected-runaway-queries).
The query stops because it meets the quarantined watch condition of a runaway query. See [Runaway Queries](/tidb-resource-control-runaway-queries.md).

* Error Number: 8260

Expand Down
2 changes: 1 addition & 1 deletion faq/sql-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ In addition, you can also use the [SQL binding](/sql-plan-management.md#sql-bind

## How to prevent the execution of a particular SQL statement?

For TiDB v7.5.0 or later versions, you can use the [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) statement to terminate specific SQL statements. For more details, see [Manage queries that consume more resources than expected (Runaway Queries)](/tidb-resource-control.md#query-watch-parameters).
For TiDB v7.5.0 or later versions, you can use the [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) statement to terminate specific SQL statements. For more details, see [Manage queries that consume more resources than expected (Runaway Queries)](/tidb-resource-control-runaway-queries.md#query-watch-parameters).

For versions earlier than TiDB v7.5.0, you can create [SQL bindings](/sql-plan-management.md#sql-binding) with the [`MAX_EXECUTION_TIME`](/optimizer-hints.md#max_execution_timen) hint to limit the execution time of a particular statement to a small value (for example, 1ms). In this way, the statement is terminated automatically by the threshold.

Expand Down
2 changes: 1 addition & 1 deletion information-schema/information-schema-resource-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: Learn the `RESOURCE_GROUPS` information_schema table.

# RESOURCE_GROUPS

The `RESOURCE_GROUPS` table shows the information about all resource groups. For more information, see [Use Resource Control to Achieve Resource Isolation](/tidb-resource-control.md).
The `RESOURCE_GROUPS` table shows the information about all resource groups. For more information, see [Use Resource Control to Achieve resource group limitation](/tidb-resource-control.md).

> **Note:**
>
Expand Down
2 changes: 1 addition & 1 deletion information-schema/information-schema-runaway-watches.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: Learn the `RUNAWAY_WATCHES` INFORMATION_SCHEMA table.

# RUNAWAY_WATCHES

The `RUNAWAY_WATCHES` table shows the watch list of runaway queries that consume more resources than expected. For more information, see [Runaway Queries](/tidb-resource-control.md#manage-queries-that-consume-more-resources-than-expected-runaway-queries).
The `RUNAWAY_WATCHES` table shows the watch list of runaway queries that consume more resources than expected. For more information, see [Runaway Queries](/tidb-resource-control-runaway-queries.md).

> **Note:**
>
Expand Down
2 changes: 1 addition & 1 deletion releases/release-7.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Quick access: [Quick start](https://docs.pingcap.com/tidb/v7.2/quick-start-with-

Automatic management of queries that consume more resources than expected provides you with an effective means to quickly respond to unexpected query performance problems. This feature can reduce the impact of the problem on overall database performance, thereby improving database stability.

For more information, see [documentation](/tidb-resource-control.md#manage-queries-that-consume-more-resources-than-expected-runaway-queries).
For more information, see [documentation](/tidb-resource-control-runaway-queries.md).

* Enhance the capability of creating a binding according to a historical execution plan [#39199](https://github.com/pingcap/tidb/issues/39199) @[qw4990](https://github.com/qw4990)

Expand Down
2 changes: 1 addition & 1 deletion releases/release-7.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Quick access: [Quick start](https://docs.pingcap.com/tidb/v7.3/quick-start-with-

This feature provides an effective intervention method for sudden performance issues in the database. For performance issues caused by queries, before identifying the root cause, this feature can quickly alleviate its impact on overall performance, thereby improving system service quality.

For more information, see [documentation](/tidb-resource-control.md#query-watch-parameters).
For more information, see [documentation](/tidb-resource-control-runaway-queries.md#query-watch-parameters).

### SQL

Expand Down
2 changes: 1 addition & 1 deletion releases/release-7.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Quick access: [Quick start](https://docs.pingcap.com/tidb/v7.4/quick-start-with-

By default, the task types that are marked as background tasks are empty, and the management of background tasks is disabled. This default behavior is the same as that of versions prior to TiDB v7.4.0. To manage background tasks, you need to manually modify the background task types of the `default` resource group.

For more information, see [documentation](/tidb-resource-control.md#manage-background-tasks).
For more information, see [documentation](/tidb-resource-control-background-tasks.md).

* Lock statistics becomes generally available (GA) [#46351](https://github.com/pingcap/tidb/issues/46351) @[hi-rustin](https://github.com/Rustin170506)

Expand Down
2 changes: 1 addition & 1 deletion releases/release-8.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Compared with the previous LTS 7.5.0, 8.1.0 includes new features, improvements,

The automatic management capability of queries that consume more resources than expected provides users with an effective means to quickly mitigate the impact of query problems on overall performance before the root cause is identified, thereby improving the stability of the database.

For more information, see [documentation](/tidb-resource-control.md#manage-queries-that-consume-more-resources-than-expected-runaway-queries).
For more information, see [documentation](/tidb-resource-control-runaway-queries.md).

### SQL

Expand Down
6 changes: 3 additions & 3 deletions releases/release-8.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ Quick access: [Quick start](https://docs.pingcap.com/tidb/v8.4/quick-start-with-

You can observe the corresponding fields (`RESOURCE_GROUP`, `MAX_REQUEST_UNIT_WRITE`, `MAX_REQUEST_UNIT_READ`, `MAX_PROCESSED_KEYS`) in the [Statement Summary Tables](/statement-summary-tables.md) to determine the condition values based on historical execution.

For more information, see [documentation](/tidb-resource-control.md#manage-queries-that-consume-more-resources-than-expected-runaway-queries).
For more information, see [documentation](/tidb-resource-control-runaway-queries.md).

* Support switching resource groups for runaway queries [#54434](https://github.com/pingcap/tidb/issues/54434) @[JmPotato](https://github.com/JmPotato)

Starting from TiDB v8.4.0, you can switch the resource group of runaway queries to a specific one. If the `COOLDOWN` mechanism fails to lower resource consumption, you can create a [resource group](/tidb-resource-control.md#create-a-resource-group), limit its resource size, and set the `SWITCH_GROUP` parameter to move identified runaway queries to this group. Meanwhile, subsequent queries within the same session will continue to execute in the original resource group. By switching resource groups, you can manage resource usage more precisely, and control the resource consumption more strictly.

For more information, see [documentation](/tidb-resource-control.md#query_limit-parameters).
For more information, see [documentation](/tidb-resource-control-runaway-queries.md#query_limit-parameters).

* Support setting the cluster-level Region scattering strategy using the `tidb_scatter_region` system variable [#55184](https://github.com/pingcap/tidb/issues/55184) @[D3Hunter](https://github.com/D3Hunter)

Expand All @@ -170,7 +170,7 @@ Quick access: [Quick start](https://docs.pingcap.com/tidb/v8.4/quick-start-with-

TiDB resource control can identify and lower the priority of background tasks. In certain scenarios, you might want to limit the resource consumption of background tasks, even when resources are available. Starting from v8.4.0, you can use the `UTILIZATION_LIMIT` parameter to set the maximum percentage of resources that background tasks can consume. Each node will keep the resource usage of all background tasks below this percentage. This feature enables precise control over resource consumption for background tasks, further enhancing cluster stability.

For more information, see [documentation](/tidb-resource-control.md#manage-background-tasks).
For more information, see [documentation](/tidb-resource-control-background-tasks.md).

* Optimize the resource allocation strategy of resource groups [#50831](https://github.com/pingcap/tidb/issues/50831) @[nolouch](https://github.com/nolouch)

Expand Down
4 changes: 2 additions & 2 deletions sql-statements/sql-statement-alter-resource-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ TiDB supports the following `DirectResourceGroupOption`, where [Request Unit (RU
| `RU_PER_SEC` | Rate of RU backfilling per second | `RU_PER_SEC = 500` indicates that this resource group is backfilled with 500 RUs per second |
| `PRIORITY` | The absolute priority of tasks to be processed on TiKV | `PRIORITY = HIGH` indicates that the priority is high. If not specified, the default value is `MEDIUM`. |
| `BURSTABLE` | If the `BURSTABLE` attribute is set, TiDB allows the corresponding resource group to use the available system resources when the quota is exceeded. |
| `QUERY_LIMIT` | When the query execution meets this condition, the query is identified as a runaway query and the corresponding action is executed. | `QUERY_LIMIT=(EXEC_ELAPSED='60s', ACTION=KILL, WATCH=EXACT DURATION='10m')` indicates that the query is identified as a runaway query when the execution time exceeds 60 seconds. The query is terminated. All SQL statements with the same SQL text will be terminated immediately in the coming 10 minutes. `QUERY_LIMIT=()` or `QUERY_LIMIT=NULL` means that runaway control is not enabled. See [Runaway Queries](/tidb-resource-control.md#manage-queries-that-consume-more-resources-than-expected-runaway-queries). |
| `BACKGROUND` | Configure the background tasks. For more details, see [Manage background tasks](/tidb-resource-control.md#manage-background-tasks). | `BACKGROUND=(TASK_TYPES="br,stats", UTILIZATION_LIMIT=30)` indicates that the backup and restore and statistics collection related tasks are scheduled as background tasks, and background tasks can consume 30% of the TiKV resources at most. |
| `QUERY_LIMIT` | When the query execution meets this condition, the query is identified as a runaway query and the corresponding action is executed. | `QUERY_LIMIT=(EXEC_ELAPSED='60s', ACTION=KILL, WATCH=EXACT DURATION='10m')` indicates that the query is identified as a runaway query when the execution time exceeds 60 seconds. The query is terminated. All SQL statements with the same SQL text will be terminated immediately in the coming 10 minutes. `QUERY_LIMIT=()` or `QUERY_LIMIT=NULL` means that runaway control is not enabled. See [Runaway Queries](/tidb-resource-control-runaway-queries.md). |
| `BACKGROUND` | Configure the background tasks. For more details, see [Manage background tasks](/tidb-resource-control-background-tasks.md). | `BACKGROUND=(TASK_TYPES="br,stats", UTILIZATION_LIMIT=30)` indicates that the backup and restore and statistics collection related tasks are scheduled as background tasks, and background tasks can consume 30% of the TiKV resources at most. |

> **Note:**
>
Expand Down
2 changes: 1 addition & 1 deletion sql-statements/sql-statement-create-resource-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ TiDB supports the following `DirectResourceGroupOption`, where [Request Unit (RU
| `RU_PER_SEC` | Rate of RU backfilling per second | `RU_PER_SEC = 500` indicates that this resource group is backfilled with 500 RUs per second |
| `PRIORITY` | The absolute priority of tasks to be processed on TiKV | `PRIORITY = HIGH` indicates that the priority is high. If not specified, the default value is `MEDIUM`. |
| `BURSTABLE` | If the `BURSTABLE` attribute is set, TiDB allows the corresponding resource group to use the available system resources when the quota is exceeded. |
| `QUERY_LIMIT` | When the query execution meets this condition, the query is identified as a runaway query and the corresponding action is executed. | `QUERY_LIMIT=(EXEC_ELAPSED='60s', ACTION=KILL, WATCH=EXACT DURATION='10m')` indicates that the query is identified as a runaway query when the execution time exceeds 60 seconds. The query is terminated. All SQL statements with the same SQL text will be terminated immediately in the coming 10 minutes. `QUERY_LIMIT=()` or `QUERY_LIMIT=NULL` means that runaway control is not enabled. See [Runaway Queries](/tidb-resource-control.md#manage-queries-that-consume-more-resources-than-expected-runaway-queries). |
| `QUERY_LIMIT` | When the query execution meets this condition, the query is identified as a runaway query and the corresponding action is executed. | `QUERY_LIMIT=(EXEC_ELAPSED='60s', ACTION=KILL, WATCH=EXACT DURATION='10m')` indicates that the query is identified as a runaway query when the execution time exceeds 60 seconds. The query is terminated. All SQL statements with the same SQL text will be terminated immediately in the coming 10 minutes. `QUERY_LIMIT=()` or `QUERY_LIMIT=NULL` means that runaway control is not enabled. See [Runaway Queries](/tidb-resource-control-runaway-queries.md). |

> **Note:**
>
Expand Down
4 changes: 2 additions & 2 deletions sql-statements/sql-statement-query-watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ DropQueryWatchStmt ::=

## Parameters

See [`QUERY WATCH` parameters](/tidb-resource-control.md#query-watch-parameters).
See [`QUERY WATCH` parameters](/tidb-resource-control-runaway-queries.md#query-watch-parameters).

## MySQL compatibility

This statement is a TiDB extension to MySQL syntax.

## See also

* [Runaway Queries](/tidb-resource-control.md#manage-queries-that-consume-more-resources-than-expected-runaway-queries)
* [Runaway Queries](/tidb-resource-control-runaway-queries.md)
10 changes: 5 additions & 5 deletions system-variable-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1895,7 +1895,7 @@ Referenced in:
- [SET RESOURCE GROUP](/sql-statements/sql-statement-set-resource-group.md)
- [System Variables](/system-variables.md#tidb_enable_resource_control-new-in-v660)
- [TiKV Configuration File](/tikv-configuration-file.md)
- [Use Resource Control to Achieve Resource Isolation](/tidb-resource-control.md)
- [Use Resource Control to Achieve resource group limitation](/tidb-resource-control.md)
- [`CALIBRATE RESOURCE`](/sql-statements/sql-statement-calibrate-resource.md)
- [TiDB 7.4.0 Release Notes](/releases/release-7.4.0.md)
- [TiDB 7.0.0 Release Notes](/releases/release-7.0.0.md)
Expand Down Expand Up @@ -2479,7 +2479,7 @@ Referenced in:
Referenced in:

- [System Variables](/system-variables.md#tidb_last_query_info-new-in-v4014)
- [Use Resource Control to Achieve Resource Isolation](/tidb-resource-control.md)
- [Use Resource Control to Achieve resource group limitation](/tidb-resource-control.md)
- [TiDB 7.6.0 Release Notes](/releases/release-7.6.0.md)
- [TiDB 7.5.1 Release Notes](/releases/release-7.5.1.md)

Expand Down Expand Up @@ -3353,7 +3353,7 @@ Referenced in:
Referenced in:

- [System Variables](/system-variables.md#tidb_request_source_type-new-in-v740)
- [Use Resource Control to Achieve Resource Isolation](/tidb-resource-control.md)
- [Use Resource Control to Achieve resource group limitation](/tidb-resource-control.md)
- [TiDB 7.4.0 Release Notes](/releases/release-7.4.0.md)

### tidb_resource_control_strict_mode
Expand All @@ -3364,7 +3364,7 @@ Referenced in:
- [Privilege Management](/privilege-management.md)
- [SET RESOURCE GROUP](/sql-statements/sql-statement-set-resource-group.md)
- [System Variables](/system-variables.md#tidb_resource_control_strict_mode-new-in-v820)
- [Use Resource Control to Achieve Resource Isolation](/tidb-resource-control.md)
- [Use Resource Control to Achieve resource group limitation](/tidb-resource-control.md)
- [TiDB 8.2.0 Release Notes](/releases/release-8.2.0.md)

### tidb_restricted_read_only
Expand Down Expand Up @@ -4152,7 +4152,7 @@ Referenced in:
- [Limited SQL features on TiDB Cloud](https://docs.pingcap.com/tidbcloud/limited-sql-features)
- [System Variables](/system-variables.md#txn_scope)
- [TiDB Configuration File](/tidb-configuration-file.md)
- [Use Resource Control to Achieve Resource Isolation](/tidb-resource-control.md)
- [Use Resource Control to Achieve resource group limitation](/tidb-resource-control.md)

### validate_password.check_user_name

Expand Down
Loading
Loading