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 TiDB workload repository #20127

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

hfxsd
Copy link
Collaborator

@hfxsd hfxsd commented Mar 27, 2025

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).

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

Copy link

ti-chi-bot bot commented Mar 27, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from hfxsd, ensuring that each of them provides their approval before proceeding. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added contribution This PR is from a community contributor. missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 27, 2025
@hfxsd hfxsd self-assigned this Mar 27, 2025
@hfxsd hfxsd added translation/from-docs This PR is translated from a PR in pingcap/docs. v9.0-beta.1 This PR/issue applies to TiDB v9.0-beta.1. and removed contribution This PR is from a community contributor. missing-translation-status This PR does not have translation status info. labels Mar 27, 2025
@hfxsd hfxsd requested review from bb7133, songrijie and lilin90 March 27, 2025 02:32
@hfxsd hfxsd added the type/compatibility-or-feature-change This PR involves compatibility changes or feature behavior changes. label Mar 31, 2025
@hfxsd hfxsd requested a review from qiancai March 31, 2025 03:59

## 快照采样过程(默认每小时)

快照采样过程每 15 分钟到 2 小时运行一次,从各种监控表中采样数据。快照由指定时间间隔内的某个 TiDB 节点发起,过程如下:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
快照采样过程每 15 分钟到 2 小时运行一次,从各种监控表中采样数据。快照由指定时间间隔内的某个 TiDB 节点发起,过程如下:
快照采样过程每 15 分钟到 2 小时运行一次,从存储累计指标的内存表中采样数据。快照由指定时间间隔内的某个 TiDB 节点发起,过程如下:

```sql
ADMIN WORKLOAD REPOSITORY TAKE SNAPSHOT;
```

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
手动快照并不会改变下一次自动快照的发生时间。


## 基于时间的采样过程(默认每 5 秒)

基于时间的采样过程每 1 秒到 600 秒运行一次,从各种监控表中采样数据。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
基于时间的采样过程每 1 秒到 600 秒运行一次,从各种监控表中采样数据
基于时间的采样间隔可设置为 1 秒 到 600 秒之间的任意时间,从各个记录瞬时状态的系统表中采样数据

```sql
SET GLOBAL tidb_workload_repository_active_sampling_interval = 20; -- 将间隔设置为 20 秒
```

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
把间隔设置为`0`将会禁用基于时间的采样。

# TiDB Workload Repository

Workload Repository 是一个用于收集和存储 TiDB 集群历史工作负载数据的系统。它会定期采样各种系统表,以跟踪集群的性能和使用模式。

Copy link
Contributor

@songrijie songrijie Mar 31, 2025

Choose a reason for hiding this comment

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

Suggested change
Workload Repository 适用以下场景:
* **故障定位**:数据库故障可能发生在特定时刻或某个过去的时间段。为了有效诊断问题,需要回溯过去的活动或事件,找出根本原因。
* **自动运维**:数据库自动运维依赖历史负载数据。通过深入挖掘更丰富的历史数据,TiDB 可以为你提供更精准的运维和调优建议,如索引推荐、绑定推荐等。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files. translation/from-docs This PR is translated from a PR in pingcap/docs. type/compatibility-or-feature-change This PR involves compatibility changes or feature behavior changes. v9.0-beta.1 This PR/issue applies to TiDB v9.0-beta.1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants