v.22.2Improvement

Respect cgroups limits in max_threads autodetection

Respect cgroups limits in max_threads autodetection. #33342 (JaySon).
ClickHouse now respects cgroups limits when autodetecting the max_threads setting.

Why it matters

This feature ensures that ClickHouse correctly limits the maximum number of threads used based on the resource constraints defined by cgroups. It solves the problem of ignoring cgroups restrictions, which could lead to overconsumption of CPU resources and degrade performance on containerized or resource-limited environments.

How to use it

This behavior is applied automatically when running ClickHouse in environments with cgroups configured. Users do not need to manually enable anything; the max_threads setting will autodetect and respect cgroups limits by default.