Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: OOM
[TiDB Usage Environment] Production Environment
[TiDB Version] 6.1.0
[Reproduction Path] Report export, tidb_server encountered OOM
Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: OOM
[TiDB Usage Environment] Production Environment
[TiDB Version] 6.1.0
[Reproduction Path] Report export, tidb_server encountered OOM
The image is not visible. Please provide the text content for translation.
The image you provided is not accessible. Please provide the text content you need translated.
Besides adjusting SQL, are there any other ways to prevent OOM from happening?
Adding some virtual memory might be effective, but I’m worried that the machine might freeze and become unresponsive.
Check if there are any expensive statements in the logs that can be optimized.
tidb_mem-quota-query
and tidb_mem-quota-concurrency
to limit memory usage for individual queries and concurrent operations.Is the program connection reset related to TiDB when there is no OOM in TiDB?
[2024/04/04 03:48:07.837 +08:00] [Error] [terror.go:307] [“encountered error”] [error=“write tcp 10.251.82.17:4000->10.255.11.4:4674: write: connection reset by peer”] [stack="github.com/pingcap/tidb/parser/terror.Log\n\t/home/jenkins/agent/workspace/build-
Upgrading the version provides a better experience in managing OOM issues. At least upgrade to 6.1.7…
If possible, it’s best to upgrade to 6.5.x.
It seems that version 6.1.0 does handle OOM issues rather poorly. It is recommended to upgrade to version 6.1.7. If upgrading is not possible at the moment, you can set the tidb_mem_quota_query
parameter and use it in conjunction with tidb_mem_oom_action
. Alternatively, you can increase the TiFlash replicas for the corresponding large tables in the reports, and try to route report-related queries to TiFlash to prevent excessive memory usage in TiDB.
Shouldn’t this be a network issue?
10.251.82.17:4000->10.255.11.4:4674
Can these two addresses communicate with each other?