unexpected cpu usage caused by tidb_server_memory_gc_trigger #48741
Labels
affects-6.5
affects-7.1
affects-7.5
severity/major
sig/execution
SIG execution
type/bug
This issue is a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Analysis:
The tidb-server utilizes
tidb_server_memory_limit_gc_trigger
to set the memory threshold that actively triggers the golang garbage collection (GC). When theheapInUse
memory reaches the threshold oftidb_server_memory_limit * tidb_server_memory_limit_gc_trigger
, it actively triggers a golang GC. To avoid overly frequent GC, in the code implementation, after this threshold is touched once, it is adjusted from the default value of 0.7 to 1.1, and after 1 minute, it is reset back to 0.7.Due to the periodic update of global system variables by tidb-server, the operation of increasing
tidb_server_memory_limit_gc_trigger
from 0.7 to 1.1 to reduce the GC frequency is almost ineffective. Therefore, when theheapInUse
of tidb-server remains above the threshold oftidb_server_memory_limit * tidb_server_memory_limit_gc_trigger
for an extended period, a high-frequency GC phenomenon occurs, leading to the CPU being in a near-maximum utilization state for an extended duration.2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
v7.3.0
The text was updated successfully, but these errors were encountered: