After executing a large number of DDL operations, the CPU usage of one TiDB instance remains very high

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

Original topic: 在执行大量的ddl操作之后,其中一个tidb cpu 一只很高

| username: Holland

[TiDB Usage Environment] Testing
[TiDB Version] v7.1.2
[Reproduction Path] Created hundreds of thousands of databases
[Encountered Problem: Symptoms and Impact] The CPU of one TiDB node remains high (even after all DDL operations are completed, it does not decrease)
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

| username: Jellybean | Original post link

The consistently high CPU usage in TiDB indicates that a large amount of CPU computation is being executed.

You can check the top SQL and slow SQL in the Dashboard to identify the statements consuming the most CPU for further analysis.

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

If a single node has high CPU usage, you can check topsql in the dashboard, select the abnormal node, and see which SQL statements are consuming the most resources.

| username: 大飞哥online | Original post link

Check out the slow SQL.

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

Go to the topsql interface, select this TiDB, and see what it’s doing.

I guess it should be an automatic task like analyze.

| username: Kongdom | Original post link

Execute the statement to check if the DDL has been completed:
ADMIN SHOW DDL JOBS

| username: Jolyne | Original post link

Confirm whether the DDL has actually been executed.
Check the topsql on the dashboard, and look at the time consumption and statement situation of each TiDB node.

| username: TiDBer_小阿飞 | Original post link

Have you implemented load balancing? Is the database connected to by the business on this node?

| username: andone | Original post link

TiDB only performs DDL operations on one node, which is normal.

| username: 芮芮是产品 | Original post link

Normal DDL requires CPU.

| username: heiwandou | Original post link

DDL is being executed on this node.

| username: dba远航 | Original post link

Directly use the TOP command on the system of this node to check. Sometimes third-party monitoring can be abnormal and inaccurate.

| username: swino | Original post link

Optimize slow SQL on abnormal nodes