[TiDB Usage Environment] Production Environment
[TiDB Version] 6.5
[Reproduction Path] Occasional
[Encountered Problem: Problem Phenomenon and Impact]
Occasional long duration for update by id, upon checking the execution process, it was found that the locking time is long.
[Attachments: Screenshots/Logs/Monitoring]
By default, it is enabled. If the business logic does not require pessimistic locking extensively, you can set the global mode to optimistic locking and manually enable it in transactions that require pessimistic locking. You can refer to the documentation:
If Prometheus has basic auth enabled, modify the file specified by the Prometheus startup parameter --web.config.file, refer to this article, and then restart Prometheus.
If you forgot the Grafana password, refer to the reply from the expert above.
Add more monitoring. This is ops, representing the amount for this scheduler. Also, check the wait duration to see how much it is.
Additionally, post the total CPU and thread CPU for review.