Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: global max_execution_time不生效问题
[TiDB Usage Environment] Production Environment
[TiDB Version] v5.4.2
[Reproduction Path] SET GLOBAL max_execution_time=8000;
[Encountered Problem: Phenomenon and Impact]
Scheduled tasks set max_execution_time to 8000 during the day and 180000 at night. After setting successfully, the TiDB monitoring panel shows a large number of slow queries during the day with execution times greater than 20 seconds, and even some exceeding 40 seconds, causing a database crash.
mysql> SHOW GLOBAL VARIABLES LIKE ‘max_execution_time’;
±-------------------±------+
| Variable_name | Value |
±-------------------±------+
| max_execution_time | 8000 |
±-------------------±------+
1 row in set
mysql>
What could be the reason for max_execution_time not taking effect? How can we effectively kill slow queries during peak business hours? Thank you.
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]