Issue of Slow Reads in TiDB

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

Original topic: TIDB出现读慢的问题

| username: Jjjjayson_zeng

[TiDB Usage Environment] Production Environment
[TiDB Version] v6.5.1
[Reproduction Path] Operations performed that led to the issue
[Encountered Issue: Phenomenon and Impact]
[Resource Configuration] 3 PD nodes, 5 TiKV nodes, 1 TiFlash node, all with 8 cores and 32GB RAM
[Attachments: Screenshots/Logs/Monitoring]
This is the highest CPU usage on one machine, others are basically below 50%

| username: 裤衩儿飞上天 | Original post link

  1. For slow SQL, post the execution plan for us to take a look.
  2. If it’s confirmed that the read is slow, post the relevant performance-read monitoring data for us to check.
| username: Jjjjayson_zeng | Original post link

What is this parameter? I’m not quite sure. It seems that my monitoring doesn’t have it.

| username: dba-kit | Original post link

Open the TiDB Dashboard and check the Slow Queries, TopSQL, and Statement Analysis pages. Especially on the TopSQL page, you can basically identify which SQL statements are consuming the most CPU.

| username: TiDBer_pkQ5q1l0 | Original post link

First, troubleshoot the slow SQL issue.

| username: xingzhenxiang | Original post link

Dashboard
View sentence analysis

| username: xingzhenxiang | Original post link

This is Grafana
image

| username: Jjjjayson_zeng | Original post link

The slow SQL queries that could be killed have already been killed, but it’s still not working well.

| username: Jjjjayson_zeng | Original post link

I don’t quite understand where you saw this, but I directly checked the database processlist. Anyway, there are no very long SQL queries, but overall it is still very slow.

| username: dba-kit | Original post link

You can refer to the official documentation for deployment instructions: 部署 TiDB Dashboard | PingCAP 文档中心

However, you can first display the cluster distribution. If the slow SQL queries have already been killed but only one TiKV node still has high CPU usage, it is likely a hotspot issue (high-frequency small queries). You can check the topSQL panel in the TiDB Dashboard, select the TiKV node with high CPU usage, and see which type of SQL is consuming the most CPU.

| username: tidb菜鸟一只 | Original post link

Is the node with high CPU usage TiKV or TiDB?

| username: Jjjjayson_zeng | Original post link

All database query statements are very slow…

| username: Jjjjayson_zeng | Original post link

Not sure if it’s TiKV, PD, or something else.

| username: jansu-dev | Original post link

Is it convenient to collect a full monitoring report with Clinic? Currently, there is too little information, and we are relying on guesswork --》 PingCAP Clinic Quick Start Guide | PingCAP Documentation Center
It’s equivalent to getting an AWR report in Oracle!!!

| username: yulei7633 | Original post link

Without the specific SQL, how can we analyze the problem? Please post the SQL.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.