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

v6.2: add doc for auto analyze auto tune support #9630

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions dynamic-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,12 @@ The following TiKV configuration items can be modified online:
| `pessimistic-txn.pipelined` | Determines whether to enable the pipelined pessimistic locking process |
| `pessimistic-txn.in-memory` | Determines whether to enable the in-memory pessimistic lock |
| `quota.foreground-cpu-time` | The soft limit on the CPU resources used by TiKV foreground to process read and write requests |
| `quota.foreground-write-bandwidth` | The soft limit on the bandwidth with which transactions write data |
| `quota.foreground-read-bandwidth` | The soft limit on the bandwidth with which transactions and the Coprocessor read data |
| `quota.foreground-write-bandwidth` | The soft limit on the bandwidth with which foreground transactions write data |
| `quota.foreground-read-bandwidth` | The soft limit on the bandwidth with which foreground transactions and the Coprocessor read data |
| `quota.background-cpu-time` | The soft limit on the CPU resources used by TiKV background to process read and write requests |
| `quota.background-write-bandwidth` | The soft limit on the bandwidth with which background transactions write data (not effective yet) |
| `quota.background-read-bandwidth` | The soft limit on the bandwidth with which background transactions and the Coprocessor read data (not effective yet) |
| `quota.enable-auto-tune` | Whether to enable the auto-tuning of quota. If this configuration item is enabled, TiKV dynamically adjusts the quota for the background requests based on the load of TiKV instances. |
| `quota.max-delay-duration` | The maximum time that a single read or write request is forced to wait before it is processed in the foreground |
| `gc.ratio-threshold` | The threshold at which Region GC is skipped (the number of GC versions/the number of keys) |
| `gc.batch-keys` | The number of keys processed in one batch |
Expand Down
4 changes: 0 additions & 4 deletions sql-statements/sql-statement-show-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ aliases: ['/docs/dev/sql-statements/sql-statement-show-config/']

# SHOW CONFIG

> **Warning:**
>
> This feature is currently an experimental feature. It is not recommended to use this feature in the production environment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的改动和 quota limiter GA 无关吧, 为什么会有这个?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

顺便改的,和 feature 无关,可以忽略

The `SHOW CONFIG` statement is used to show the current configuration of various components of TiDB. Note that the configuration and system variables act on different dimensions and should not be mixed up. If you want to obtain the system variable information, use the [SHOW VARIABLES](/sql-statements/sql-statement-show-variables.md) syntax.

## Synopsis
Expand Down
67 changes: 55 additions & 12 deletions tikv-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -1660,33 +1660,76 @@ For pessimistic transaction usage, refer to [TiDB Pessimistic Transaction Mode](

Configuration items related to Quota Limiter.

Suppose that your machine on which TiKV is deployed has limited resources, for example, with only 4v CPU and 16 G memory. In this situation, the foreground of TiKV might process too many read and write requests so that the CPU resources used by the background are occupied to help process such requests, which affects the performance stability of TiKV. To avoid this situation, you can use the quota-related configuration items to limit the CPU resources to be used by the foreground. When a request triggers Quota Limiter, the request is forced to wait for a while for TiKV to free up CPU resources. The exact waiting time depends on the number of requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-duration-new-in-v600).
### `max-delay-duration` <span class="version-mark">New in v6.0.0</span>

> **Warning:**
>
> - Quota Limiter is an experimental feature introduced in TiDB v6.0.0, and it is **NOT** recommended to use it in the production environment.
> - This feature is only suitable for environments with limited resources to ensure that TiKV can run stably in those environments. If you enable this feature in an environment with rich resources, performance degradation might occur when the amount of requests reaches a peak.
+ The maximum time that a single read or write request is forced to wait before it is processed in the foreground.
+ Default value: `500ms`
+ Recommended setting: It is recommended to use the default value in most cases. If out of memory (OOM) or violent performance jitter occurs in the instance, you can set the value to 1S to make the request waiting time shorter than 1 second.

### Foreground Quota Limiter

Configuration items related to foreground Quota Limiter.

Suppose that your machine on which TiKV is deployed has limited resources, for example, with only 4v CPU and 16 G memory. In this situation, the foreground of TiKV might process too many read and write requests so that the CPU resources used by the background are occupied to help process such requests, which affects the performance stability of TiKV. To avoid this situation, you can use the foreground quota-related configuration items to limit the CPU resources to be used by the foreground. When a request triggers Quota Limiter, the request is forced to wait for a while for TiKV to free up CPU resources. The exact waiting time depends on the number of requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-duration-new-in-v600).

### `foreground-cpu-time` (new in v6.0.0)
#### `foreground-cpu-time` <span class="version-mark">New in v6.0.0</span>

+ The soft limit on the CPU resources used by TiKV foreground to process read and write requests.
+ Default value: `0` (which means no limit)
+ Unit: millicpu (for example, `1500` means that foreground requests consume 1.5v CPU)
+ Unit: millicpu (for example, `1500` means that the foreground requests consume 1.5v CPU)
+ Recommended setting: For the instance with more than 4 cores, use the default value `0`. For the instance with 4 cores, setting the value to the range of `1000` and `1500` can make a balance. For the instance with 2 cores, keep the value smaller than `1200`.

### `foreground-write-bandwidth` (new in v6.0.0)
#### `foreground-write-bandwidth` <span class="version-mark">New in v6.0.0</span>

+ The soft limit on the bandwidth with which transactions write data.
+ Default value: `0KB` (which means no limit)
+ Recommended setting: Use the default value `0` in most cases unless the `foreground-cpu-time` setting is not enough to limit the write bandwidth. For such an exception, it is recommended to set the value smaller than 50M in the instance with 4 or less cores.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把 50M 改成 50MB 更准确

TomShawn marked this conversation as resolved.
Show resolved Hide resolved

### `foreground-read-bandwidth` (new in v6.0.0)
#### `foreground-read-bandwidth` <span class="version-mark">New in v6.0.0</span>

+ The soft limit on the bandwidth with which transactions and the Coprocessor read data.
+ Default value: `0KB` (which means no limit)
+ + Recommended setting: Use the default value `0` in most cases unless the `foreground-cpu-time` setting is not enough to limit the read bandwidth. For such an exception, it is recommended to set the value smaller than 20M in the instance with 4 or less cores.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

### `max-delay-duration` (new in v6.0.0)
### Background Quota Limiter

+ The maximum time that a single read or write request is forced to wait before it is processed in the foreground.
+ Default value: `500ms`
Configuration items related to background Quota Limiter.

Suppose that your machine on which TiKV is deployed has limited resources, for example, with only 4v CPU and 16 G memory. In this situation, the background of TiKV might process too many calculations and read and write requests, so that the CPU resources used by the foreground are occupied to help process such requests, which affects the performance stability of TiKV. To avoid this situation, you can use the background quota-related configuration items to limit the CPU resources to be used by the background. When a request triggers Quota Limiter, the request is forced to wait for a while for TiKV to free up CPU resources. The exact waiting time depends on the number of requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-duration-new-in-v600).

> **Warning:**
>
> - Background Quota Limiter is an experimental feature introduced in TiDB v6.2.0, and it is **NOT** recommended to use it in the production environment.
> - This feature is only suitable for environments with limited resources to ensure that TiKV can run stably in those environments. If you enable this feature in an environment with rich resources, performance degradation might occur when the amount of requests reaches a peak.

#### `background-cpu-time` <span class="version-mark">New in v6.2.0</span>

+ The soft limit on the CPU resources used by TiKV background to process read and write requests.
+ Default value: `0` (which means no limit)
+ Unit: millicpu (for example, `1500` means that the background requests consume 1.5v CPU)

#### `background-write-bandwidth` <span class="version-mark">New in v6.2.0</span>

> **Note:**
>
> This configuration item is returned in the result of `SHOW CONFIG`, but currently setting it does not take any effect.

+ The soft limit on the bandwidth with which background transactions write data.
+ Default value: `0KB` (which means no limit)

#### `background-read-bandwidth` <span class="version-mark">New in v6.2.0</span>

> **Note:**
>
> This configuration item is returned in the result of `SHOW CONFIG`, but currently setting it does not take any effect.

+ The soft limit on the bandwidth with which background transactions and the Coprocessor read data.
+ Default value: `0KB` (which means no limit)

#### `enable-auto-tune` <span class="version-mark">New in v6.2.0</span>

+ Determines whether to enable the auto-tuning of quota. If this configuration item is enabled, TiKV dynamically adjusts the quota for the background requests based on the load of TiKV instances.
+ Default value: `false` (which means that the auto-tuning is disabled)

## causal-ts <span class="version-mark">New in v6.1.0</span>

Expand Down