[Technical Video] How are Color Optimization and Time Optimization Methods Applied to the TiDB Performance Overview Panel?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 【技术视频】颜色优化法与时间优化法是如何应用于 TiDB Performance Overview面板的?

| username: Billmay表妹

Today, we will follow the explanation of #PingCAP database performance test engineer: Song Yuying; through two intuitive real cases to understand how the most mainstream performance analysis methods in the database industry: Color Optimization Method and Time Optimization Method are applied to the TiDB Performance Overview panel?

Color Optimization Method

By observing the database time decomposition chart and execution time overview chart, you can intuitively distinguish between normal or abnormal time consumption, quickly locate the abnormal bottleneck points of the cluster, and efficiently understand the load characteristics of the cluster. For normal time consumption and request types, the colors displayed in the chart are green or blue. If non-green or non-blue colors occupy a significant proportion in these two charts, it means that the distribution of database time is unreasonable.

  • Database Time By SQL Type: Blue represents Select statements, green represents DML statements such as Update, Insert, Commit, etc. Red represents General types, including commands like StmtPrepare, StmtReset, StmtFetch, StmtClose, etc.
  • Database Time By SQL Phase: The execute phase is green, while the other three phases are reddish. If the proportion of non-green colors is significant, it means that the database is consuming too much time outside the execution phase, and further analysis of the root cause is needed. A common scenario is that the inability to use the execution plan cache leads to a significant proportion of orange in the compile phase.
  • SQL Execute Time Overview: Green represents regular write KV requests (such as Prewrite and Commit), blue represents regular read KV requests (such as Cop and Get), purple represents TiFlash MPP requests, and other colors indicate issues that need attention. For example, pessimistic lock requests are red, and TSO waiting is dark brown. If the proportion of non-blue or non-green colors is significant, it means there are abnormal bottlenecks in the execution phase. For example, when there is severe lock contention, the red pessimistic lock time will be significant; when the TSO waiting time is too long in the load, the dark brown will be significant.

Example:






Click here for more details

Recommended Reading:

How to Participate in Technical Video Sharing:

TiDB Community Technical Evangelism New Way - Community Technical Practice Video
TiDB Community Technical Evangelist - Video Recording Guide

Rewards

Publishing a high-quality “video” of more than 10 minutes (same as publishing a technical article)

  • Counts as one annual contribution
    • Publishing videos or articles more than 3 times a year qualifies for MVA review
    • Publishing videos or articles more than 10 times a year qualifies for MOA review
  • Rewards experience points & points 500-2000
  • Accumulating more than 10 high-quality videos qualifies for the “Community Excellent Lecturer Title” and exclusive customized benefits.

For more benefits and awards, see: 【TiDB Community Honor】How to Become MVA & MOA?

| username: Kongdom | Original post link

Charge!

| username: 春风十里 | Original post link

Studying