v.21.11Improvements

ClickHouse Accounts for Docker/Cgroups Limitations in Memory Calculation

ClickHouse now will account docker/cgroups limitations to get system memory amount. See #25662. #30574 (Pavel Medvedev).
ClickHouse now detects and respects Docker and cgroups memory limits when determining the available system memory.

Why it matters

This feature addresses the issue where ClickHouse would incorrectly calculate system memory by ignoring container or cgroup constraints, leading to potential memory overcommitment and instability. By accounting for these limitations, ClickHouse can optimize resource usage and improve reliability in containerized environments.

How to use it

This behavior is enabled by default when running ClickHouse inside Docker containers or cgroups. No additional configuration is required; ClickHouse automatically detects and applies the memory limits imposed by the container or cgroup.