-
Notifications
You must be signed in to change notification settings - Fork 1.2k
pd: document CPU-aware hot region scheduling #21758
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
8
commits into
pingcap:master
Choose a base branch
from
qiancai:docs/cpu-aware-hot-region-scheduling-v857-23140
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.
+30
−7
Open
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e5bcfdf
Create empty translation PR
qiancai 5119cca
Auto-sync: Update Chinese docs from English PR
github-actions[bot] f8ec760
Apply suggestions from code review
qiancai 5c60a49
Update troubleshoot-hot-spot-issues.md
qiancai 8607a61
Apply suggestions from code review
qiancai c39813c
Apply suggestions from code review
qiancai 9824e3b
Update pd-control.md
qiancai d338ebb
Update troubleshoot-hot-spot-issues.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
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 |
|---|---|---|
|
|
@@ -175,7 +175,14 @@ TiDB 的 Coprocessor Cache 功能支持下推计算结果缓存。开启该功 | |
|
|
||
| ## 打散读热点 | ||
|
|
||
| 在读热点场景中,热点 TiKV 无法及时处理读请求,导致读请求排队。但是,此时并非所有 TiKV 资源都已耗尽。为了降低延迟,TiDB v7.1.0 引入了负载自适应副本读取功能,允许从其他 TiKV 节点读取副本,而无需在热点 TiKV 节点排队等待。你可以通过 [`tidb_load_based_replica_read_threshold`](/system-variables.md#tidb_load_based_replica_read_threshold-从-v700-版本开始引入) 系统变量控制读请求的排队长度。当 leader 节点的预估排队时间超过该阈值时,TiDB 会优先从 follower 节点读取数据。在读热点的情况下,与不打散读热点相比,该功能可提高读取吞吐量 70%~200%。 | ||
| 在读热点场景中,热点 TiKV 无法及时处理读请求,导致读请求排队。但是,此时并非所有 TiKV 资源都已耗尽。为了降低延时,TiDB v7.1.0 引入了负载自适应副本读取功能,允许从其他 TiKV 节点读取副本,而无需在热点 TiKV 节点排队等待。你可以通过 [`tidb_load_based_replica_read_threshold`](/system-variables.md#tidb_load_based_replica_read_threshold-从-v700-版本开始引入) 系统变量控制读请求的排队长度。当 leader 节点的预估排队时间超过该阈值时,TiDB 会优先从 follower 节点读取数据。在读热点的情况下,与不打散读热点相比,该功能可提高读取吞吐量 70%~200%。 | ||
|
|
||
| 从 v8.5.7 和 v9.0.0 开始,针对读热点,PD 支持基于 TiKV CPU 使用情况的热点 Region 调度。TiKV 在 Store 心跳中上报每个 Region 的读 CPU 使用情况,PD 可将 CPU 使用情况作为调度维度之一。该机制有助于 PD 识别出那些 QPS 或字节吞吐量看似均衡、但 TiKV CPU 使用量仍不均衡的读热点,例如包含不同 CPU 开销的负载,或不同 TiKV 节点处理不同负载模式的集群。 | ||
|
qiancai marked this conversation as resolved.
Outdated
|
||
|
|
||
| - 对于支持上报读 CPU 使用情况的集群,`balance-hot-region-scheduler` 的默认 `read-priorities` 值为 `cpu,byte`。 | ||
| - 对于不支持上报读 CPU 使用情况的集群,PD 会自动回退到 `query,byte`;如果集群也不支持 `query` 维度,则回退到 `byte,key`。 | ||
|
|
||
| 如需查看或调整调度维度,请使用 [`pd-ctl scheduler config balance-hot-region-scheduler`](/pd-control.md#scheduler-config-balance-hot-region-scheduler)。 | ||
|
Comment on lines
+179
to
+185
Member
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. 忽然意识到这个是不是单独一段比较好 |
||
|
|
||
| ## 使用 TiKV MVCC 内存引擎缓解因多版本导致的读热点 | ||
|
|
||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.