High CPU usage on a single TiKV node, how should we handle it?

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

Original topic: 单个TiKV节点CPU高,请问大佬们怎么处理

| username: Ming

【TiDB Environment】Testing
【TiDB Version】v6.5.3
The CPU usage of a single TiKV component is relatively high.
The monitoring charts are as follows:



The involved SQL is as follows:

| username: caiyfc | Original post link

The read thread pressure is too high. First, try to optimize the SQL, and then see if you can split the region and distribute it to other nodes.

| username: 有猫万事足 | Original post link

It feels like the slow queries need to be optimized.

| username: 像风一样的男子 | Original post link

It’s obviously a slow query, please optimize it.

| username: Ming | Original post link

Okay, I’ll try to optimize these SQL queries first and see.

| username: 路在何chu | Original post link

This is very likely a slow query. The region involved is on one KV. Is it a hotspot? Check the heatmap.

| username: andone | Original post link

Optimize slow SQL

| username: dba远航 | Original post link

Optimize poorly performing SQL

| username: 随缘天空 | Original post link

It could be a hotspot issue. Check the traffic visualization menu in the dashboard monitoring chart to see if there are any particularly bright lines.

| username: Ming | Original post link

This parameter “s” was turned off and then turned on. Currently, it has decreased a lot, but there is still a slight difference. It can only be resolved from the SQL side.

| username: Kongdom | Original post link

:joy: Your SQL looks just like ours, using list query pagination, first querying the total count, then querying the first page. We are also very troubled by this. There’s no other way but to optimize the SQL, or when querying the total count, specify a separate SQL to reduce unnecessary field queries. However, this requires support in the program implementation.

| username: Ming | Original post link

Okay, got it.

| username: system | Original post link

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