v.25.8Improvement

Use information from cgroup

Use information from cgroup (if applicable, i.e. memory_worker_use_cgroup and cgroups are available) to adjust memory tracker (memory_worker_correct_memory_tracker). #83981 (Azat Khuzhin).
Adjust memory tracking in ClickHouse workers by utilizing cgroup information when available.

Why it matters

This feature improves the accuracy of memory usage reporting by incorporating control group (cgroup) data when the settings memory_worker_use_cgroup and appropriate cgroups are available. It ensures memory trackers reflect actual memory consumption more precisely, aiding in better resource management and monitoring.

How to use it

Enable memory correction by setting the configuration parameter memory_worker_correct_memory_tracker to true and ensure memory_worker_use_cgroup is enabled if cgroups are used. When these conditions are met, ClickHouse will adjust the memory tracker based on cgroup statistics automatically.