Skip to content

dm: add replication lag tuning guidance#22714

Open
joechenrh wants to merge 6 commits intopingcap:masterfrom
joechenrh:dm-replication-lag-guide
Open

dm: add replication lag tuning guidance#22714
joechenrh wants to merge 6 commits intopingcap:masterfrom
joechenrh:dm-replication-lag-guide

Conversation

@joechenrh
Copy link
Copy Markdown
Contributor

@joechenrh joechenrh commented Apr 8, 2026

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.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 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)?

  • This PR is translated from:
  • Other reference 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

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 8, 2026

[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 assign lance6716 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details 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 missing-translation-status This PR does not have translation status info. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 8, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the DM performance troubleshooting documentation by adding a new section on locating bottlenecks through metric analysis and providing detailed steps for diagnosing downstream execution issues in TiDB or TiKV clusters. The review feedback recommends consistent formatting by enclosing technical metric names in backticks to align with the style guide.

If the bottleneck exists in downstream execution, check the TiDB or TiKV cluster before changing DM configurations:

- If TiDB CPU usage is already high, scale out TiDB first.
- If TiDB query latency or TiDB KV-client backoff is high, the bottleneck might exist in the TiDB SQL layer or in the TiDB-to-TiKV path.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

low

For consistency and improved readability, please enclose metric names in backticks. This aligns with the formatting of other metrics in this document and the style guide's recommendation for technical terms.

Suggested change
- If TiDB query latency or TiDB KV-client backoff is high, the bottleneck might exist in the TiDB SQL layer or in the TiDB-to-TiKV path.
- If `TiDB query latency` or `TiDB KV-client backoff` is high, the bottleneck might exist in the TiDB SQL layer or in the TiDB-to-TiKV path.
References
  1. The style guide recommends using backticks for technical terms like command names, options, and paths to ensure consistency and readability. This principle should be extended to metric names as well for consistency. (link)


- If TiDB CPU usage is already high, scale out TiDB first.
- If TiDB query latency or TiDB KV-client backoff is high, the bottleneck might exist in the TiDB SQL layer or in the TiDB-to-TiKV path.
- If TiKV write path metrics such as write RPC latency, scheduler CPU usage, apply CPU usage, write stall, or PD TSO latency are high, check TiKV or PD before tuning DM.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

low

To maintain consistency with the rest of the document, please wrap these metric names in backticks. This improves readability and follows the style guide's conventions for technical terms.

Suggested change
- If TiKV write path metrics such as write RPC latency, scheduler CPU usage, apply CPU usage, write stall, or PD TSO latency are high, check TiKV or PD before tuning DM.
- If TiKV write path metrics such as `write RPC latency`, `scheduler CPU usage`, `apply CPU usage`, `write stall`, or `PD TSO latency` are high, check TiKV or PD before tuning DM.
References
  1. The style guide recommends using backticks for technical terms like command names, options, and paths to ensure consistency and readability. This principle should be extended to metric names as well for consistency. (link)

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant