Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: tidb内存爆满
The tidb_server node often causes the server to freeze due to memory overload, and the server can only be restarted. After canceling the swap, the tidb_server process will be killed and restarted due to OOM, which slightly alleviates the issue.
Will adding a tiflash node improve the situation?
Using tilfash to improve still requires analyzing specific SQL. You need to first identify the SQL that consumes a lot of memory, and then analyze it. What is the tidb_mem_quota_query variable set to? This variable currently sets the maximum memory for a single SQL (not necessarily 100% effective).
tidb_mem_quota_query=524288000
This should be the default value.
The tidb_mem_quota_query
parameter should be used in conjunction with tidb_mem_oom_action
. Setting it to cancel
means that a single session will be automatically killed when it exceeds the memory limit.
It is recommended that the configuration for adjusting the block size should not exceed 60% of the machine’s memory. After making the adjustments, restart the TiKV node.
There definitely needs to be some optimization operations, try adding one.
I am also very concerned about how to solve this problem. After your issue is resolved, could you reply with the solution? Thanks a lot~~
May I ask what is the command to refresh the configuration to the configuration file after using set global?