Get Incorrect limit_in_bytes and usage_in_bytes #22132
Labels
affects-5.0
This bug affects 5.0.x versions.
affects-5.1
This bug affects 5.1.x versions.
affects-5.2
This bug affects 5.2.x versions.
affects-5.3
This bug affects 5.3.x versions.
affects-5.4
This bug affects the 5.4.x(LTS) versions.
affects-6.0
affects-6.1
This bug affects the 6.1.x(LTS) versions.
affects-6.2
affects-6.3
severity/major
sig/execution
SIG execution
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
TiDB parses "/sys/fs/cgroup/memory/memory.limit_in_bytes" to get memory limit value and "/sys/fs/cgroup/memory/memory.usage_in_bytes" to retrieve usage currently, it's not correct in some situations.
1. Minimal reproduce step (Required)
For example, I deploy a tidb cluster through TiUP like following steps:
2. What did you expect to see? (Required)
TiDB-server should get memory limit and usage in
/sys/fs/cgroup/memory/system.slice/tidb-4000.service/memory.limit_in_bytes
andcat /sys/fs/cgroup/memory/system.slice/tidb-4000.service/memory.usage_in_bytes
3. What did you see instead (Required)
https://github.com/wshwsh12/tidb/blob/e9896cf8ae6c11e58f15fabe6802283dfd20585e/util/memory/meminfo.go#L43-L44
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: