-
Notifications
You must be signed in to change notification settings - Fork 709
scheduler: network slow store scheduler enhancement #22269
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
Open
qiancai
wants to merge
7
commits into
pingcap:master
Choose a base branch
from
qiancai:slow-store-21196
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d7c281a
Add temp.md
qiancai 1747d00
Delete temp.md
qiancai 7cc22f9
Auto-sync: Update English docs from Chinese PR
github-actions[bot] a167d14
revise translation
qiancai e0d78f3
Update pd-scheduling-best-practices.md
qiancai 8dd3ad6
Update pd-control.md
qiancai 4103456
Update tikv-configuration-file.md
qiancai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -941,7 +941,7 @@ Usage: | |||||
| >> scheduler config evict-leader-scheduler // Display the stores in which the scheduler is located since v4.0.0 | ||||||
| >> scheduler config evict-leader-scheduler add-store 2 // Add leader eviction scheduling for store 2 | ||||||
| >> scheduler config evict-leader-scheduler delete-store 2 // Remove leader eviction scheduling for store 2 | ||||||
| >> scheduler add evict-slow-store-scheduler // When there is one and only one slow store, evict all Region leaders of that store | ||||||
| >> scheduler add evict-slow-store-scheduler // Automatically detect slow-disk or slow-network nodes and evict all Region leaders from those nodes when certain conditions are met | ||||||
| >> scheduler remove grant-leader-scheduler-1 // Remove the corresponding scheduler, and `-1` corresponds to the store ID | ||||||
| >> scheduler pause balance-region-scheduler 10 // Pause the balance-region scheduler for 10 seconds | ||||||
| >> scheduler pause all 10 // Pause all schedulers for 10 seconds | ||||||
|
|
@@ -965,6 +965,44 @@ The state of the scheduler can be one of the following: | |||||
| - `pending`: the scheduler cannot generate scheduling operators. For a scheduler in the `pending` state, brief diagnostic information is returned. The brief information describes the state of stores and explains why these stores cannot be selected for scheduling. | ||||||
| - `normal`: there is no need to generate scheduling operators. | ||||||
|
|
||||||
| ### `scheduler config evict-slow-store-scheduler` | ||||||
|
|
||||||
| The `evict-slow-store-scheduler` limits PD from scheduling Leaders to abnormal TiKV nodes and actively evicts Leaders when necessary, thereby reducing the impact of slow nodes on the cluster when TiKV nodes experience disk I/O or network jitter. | ||||||
|
|
||||||
| #### Slow-disk nodes | ||||||
|
|
||||||
| Starting from v6.2.0, TiKV reports a `SlowScore` in store heartbeats to PD, calculated based on disk I/O conditions. The score ranges from 1 to 100, where a higher value indicates a higher possibility of disk performance anomalies on that node. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| For slow-disk nodes, the detection on TiKV and the scheduling via `evict-slow-store-scheduler` on PD are enabled by default, which means no additional configuration is required. | ||||||
|
|
||||||
| #### Slow-network nodes | ||||||
|
|
||||||
| Starting from v8.5.5 and v9.0.0, TiKV supports reporting a `NetworkSlowScore` in store heartbeats to PD. It is calculated based on network detection results and helps identify slow nodes experiencing network jitter. The score ranges from 1 to 100, where a higher value indicates a higher possibility of network anomalies. | ||||||
|
|
||||||
| For compatibility and resource consumption considerations, the detection and scheduling of slow-network nodes are disabled by default. To enable them, configure both of the following: | ||||||
|
|
||||||
| 1. Enable the PD scheduler to handle slow-network nodes: | ||||||
|
|
||||||
| ```bash | ||||||
| scheduler config evict-slow-store-scheduler set enable-network-slow-store true | ||||||
| ``` | ||||||
|
|
||||||
| 2. On TiKV, set the [`raftstore.inspect-network-interval`](/tikv-configuration-file.md#inspect-network-interval) configuration item to a value greater than `0` to enable network detection. | ||||||
|
|
||||||
| #### Recovery time control | ||||||
|
|
||||||
| You can specify how long a slow node must remain stable before it is considered recovered by using the `recovery-duration` parameter. | ||||||
|
|
||||||
| Example: | ||||||
|
|
||||||
| ```bash | ||||||
| >> scheduler config evict-slow-store-scheduler | ||||||
| { | ||||||
| "recovery-duration": "1800" // 30 minutes | ||||||
| } | ||||||
| >> scheduler config evict-slow-store-scheduler set recovery-duration 600 | ||||||
| ``` | ||||||
|
|
||||||
| ### `scheduler config balance-leader-scheduler` | ||||||
|
|
||||||
| Use this command to view and control the `balance-leader-scheduler` policy. | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -281,6 +281,13 @@ This document only describes the parameters that are not included in command-lin | |||||
| + Sets the size of the connection pool for service and forwarding requests to the server. Setting it to too small a value affects the request latency and load balancing. | ||||||
| + Default value: `4` | ||||||
|
|
||||||
| ### `inspect-network-interval` <span class="version-mark">New in v8.5.5 and v9.0.0</span> | ||||||
|
|
||||||
| + Controls the interval at which the TiKV HealthChecker actively performs network detection to PD and other TiKV nodes. TiKV calculates a `NetworkSlowScore` based on the network detection and reports the network status of slow nodes to PD. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| + Setting this value to `0` disables the network detection. Setting it to a smaller value increases the detection frequency, which helps detect network jitter more quickly, but it also consumes more network bandwidth and CPU resources. | ||||||
| + Default value: `100ms` | ||||||
| + Value range: 0 or `[10ms, +∞)` | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ## readpool.unified | ||||||
|
|
||||||
| Configuration items related to the single thread pool serving read requests. This thread pool supersedes the original storage thread pool and coprocessor thread pool since the 4.0 version. | ||||||
|
|
||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.