Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: INSERT语句prewrite慢
【TiDB Usage Environment】Production Environment
【TiDB Version】4.0.14
【Reproduction Path】Operations performed that led to the issue
【Encountered Issue: Phenomenon and Impact】
- Simple insert statements are executing slowly. Heatmap shows no write hotspots, and TiKV nodes are load balanced.
【Resource Configuration】TiKV 9C/90G * 6
【Attachments: Screenshots/Logs/Monitoring】
The TiDB binlog is not enabled.
Then check the disk performance monitoring to see if there are any high latency issues with TiKV IO.
As shown in the images, the ioawait of the TiKV disk is not high, and the iops can reach up to 2k+. Since the disk is SSD, it should not have reached the disk IO bottleneck.
TiDB → KV Error → backoff/transaction and TiKV-details → Scheduler monitoring to see if there are any write conflict issues;
Write conflicts also do not have exceptions. It has been found that the wait_time.snapshot of one TiKV node is often very high, sometimes lasting for several seconds. Later, the same issue occurred with updates in the same cluster. The logs are posted in another question: tikv wait_time.snapshot耗时很高 - #4,来自 tug_twf - TiDB 的问答社区