-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 TiDB workload repository #20127
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
||
## 快照采样过程(默认每小时) | ||
|
||
快照采样过程每 15 分钟到 2 小时运行一次,从各种监控表中采样数据。快照由指定时间间隔内的某个 TiDB 节点发起,过程如下: |
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.
快照采样过程每 15 分钟到 2 小时运行一次,从各种监控表中采样数据。快照由指定时间间隔内的某个 TiDB 节点发起,过程如下: | |
快照采样过程每 15 分钟到 2 小时运行一次,从存储累计指标的内存表中采样数据。快照由指定时间间隔内的某个 TiDB 节点发起,过程如下: |
```sql | ||
ADMIN WORKLOAD REPOSITORY TAKE SNAPSHOT; | ||
``` | ||
|
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.
手动快照并不会改变下一次自动快照的发生时间。 | |
|
||
## 基于时间的采样过程(默认每 5 秒) | ||
|
||
基于时间的采样过程每 1 秒到 600 秒运行一次,从各种监控表中采样数据。 |
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.
基于时间的采样过程每 1 秒到 600 秒运行一次,从各种监控表中采样数据。 | |
基于时间的采样间隔可设置为 1 秒 到 600 秒之间的任意时间,从各个记录瞬时状态的系统表中采样数据。 |
```sql | ||
SET GLOBAL tidb_workload_repository_active_sampling_interval = 20; -- 将间隔设置为 20 秒 | ||
``` | ||
|
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.
把间隔设置为`0`将会禁用基于时间的采样。 | |
# TiDB Workload Repository | ||
|
||
Workload Repository 是一个用于收集和存储 TiDB 集群历史工作负载数据的系统。它会定期采样各种系统表,以跟踪集群的性能和使用模式。 | ||
|
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.
Workload Repository 适用以下场景: | |
* **故障定位**:数据库故障可能发生在特定时刻或某个过去的时间段。为了有效诊断问题,需要回溯过去的活动或事件,找出根本原因。 | |
* **自动运维**:数据库自动运维依赖历史负载数据。通过深入挖掘更丰富的历史数据,TiDB 可以为你提供更精准的运维和调优建议,如索引推荐、绑定推荐等。 | |
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions (in Chinese).
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?