Does TiDB support SQL overload protection?

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

Original topic: TIDB 支持SQL过载保护功能么

| username: residentevil

[TiDB Usage Environment] Production Environment
[TiDB Version] v6.1.7
[Encountered Problem: Problem Phenomenon and Impact] Business SQL takes too long to execute [e.g., inaccurate execution plan, SQL writing issues leading to excessive row retrieval], consuming a lot of TiDB resources. Does TiDB currently support the feature of automatically killing requests after the query request exceeds a specified execution time?

| username: ealam_小羽 | Original post link

You can set max_execution_time to limit the maximum execution time. You can search for max_execution_time for more details, and it can be used to limit a specific SQL query, etc.

| username: residentevil | Original post link

You can directly set this parameter on the tidbserver. Executing show global variables like 'max_execution_time'; will show that the current default is 0.

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

You can set the maximum memory usage for each query.

| username: Fly-bird | Original post link

Sometimes setting the maximum memory usage for each query may not take effect, please be aware when using it.

| username: residentevil | Original post link

I feel that the max_execution_time parameter is more reliable.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.