TiDB long running queries #66520
Replies: 4 comments
-
Beta Was this translation helpful? Give feedback.
-
|
Original author: Hazel Hi @Pranit_Rahangdale , slow queries will be recorded. You can refer to the archived documentation for v4.0.14 below. The two links above are for tracking checks after SQL execution, but if the SQL is still executing, you need to query using CLUSTER_PROCESSLIST. To terminate: You can terminate it by using kill tidb [process ID]. However, a limitation in v4.0.14 is that you can only terminate queries on the current node. For example, if the TiDB nodes are 11, 22, and 33, you can only connect to node 11 to kill the queries on node 11, but not connect to node 22 to kill the queries running on node 11. This means you cannot connect to the cluster using a load balancer IP, you must connect using the specific TiDB node IP. |
Beta Was this translation helpful? Give feedback.
-
|
Original author: Pranit_Rahangdale @Hazel Is there any workaround possible to kill the long running queries completely from all the tidb nodes. In our production environment, we have 5 tidb nodes and many situations of unoptimized read and write and queries. We need to kill these queries completely from the TiDB cluster. If there is any guardrail around this, can you please suggest? |
Beta Was this translation helpful? Give feedback.
-
|
Original author: Hazel Hi @Pranit_Rahangdale You can check the ‘information_schema.cluster_processlist’ system table section in this document. PROCESSLIST. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Original author: Pranit_Rahangdale
Original time: 2025-02-17 14:22:21.254161
Original ID/Slug: 10428 / tidb-long-running-queries
Application environment:
Production
TiDB version: v4.0.14
Problem:
There are situations when queries taking longer time to execute result in high cpu usage and high I/O operations which tend to bottleneck of the tidb cluster. Is there a way to find such long running queries and any way to kill them in TiDB v4.0.14?
Beta Was this translation helpful? Give feedback.
All reactions