mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
5253a7f650
Cgroups allows to change the amount of memory available to a process while it runs. The previous logic calculated the amount of available memory only once at server startup. As a result, memory thresholds set via cgroups were not picked up when the settings changed. We now always incorporate the current limits during re-configuraton. Note 1: getMemoryAmount() opens/reads a file which is potentially expensive. Should be fine though since that happens only when the server configuration changes. Note 2: An better approach would be to treat cgroup limit changes as another trigger for ClickHouse server re-configuration (which currently only happens when the config files change). Shied away from that for now because of the case that when the cgroup limit is lowered, there is no guarantee that ClickHouse can shrink the memory amount accordingly in time (afaik, it does so only lazily by denying new allocations). As a result, the OOM killer would kill the server. The same will happen with this PR but at a lower implementation complexity. |
||
---|---|---|
.. | ||
config.d | ||
js | ||
users.d | ||
.gitignore | ||
clickhouse-server.cpp | ||
CMakeLists.txt | ||
config.xml | ||
config.yaml.example | ||
dashboard.html | ||
embedded.xml | ||
MetricsTransmitter.cpp | ||
MetricsTransmitter.h | ||
play.html | ||
resources.cpp | ||
Server.cpp | ||
Server.h | ||
users.xml | ||
users.yaml.example |