ClickHouse/programs/server
Robert Schulze 5253a7f650
Respect cgroup memory limit when reloading configuration
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.
2023-08-17 09:22:13 +00:00
..
config.d Simplification 2023-08-11 03:06:07 +02:00
js Add a file 2022-08-21 12:11:04 +02:00
users.d Remove one line from XML, because we do not care 2022-08-28 02:44:02 +02:00
.gitignore Update gitignore 2021-04-20 23:39:41 +03:00
clickhouse-server.cpp Remove dlopen 2022-09-17 03:02:34 +02:00
CMakeLists.txt Fix errors 2023-07-24 05:34:00 +02:00
config.xml Simplification 2023-08-11 03:06:07 +02:00
config.yaml.example Cleanup remote_servers in dist config.xml 2023-07-09 16:55:27 +02:00
dashboard.html fix authError behavior, fix overlapping chart behavior 2023-07-03 12:42:51 -04:00
embedded.xml Remove one line from XML, because we do not care 2022-08-28 02:44:02 +02:00
MetricsTransmitter.cpp Use StrongTypedef for ProfileEvents 2023-04-01 16:01:33 +02:00
MetricsTransmitter.h Move all folders inside /dbms one level up (#9974) 2020-04-02 02:51:21 +03:00
play.html Update play.html 2023-05-05 21:36:10 +03:00
resources.cpp Use incbin for resources, part 1 2023-07-23 06:11:03 +02:00
Server.cpp Respect cgroup memory limit when reloading configuration 2023-08-17 09:22:13 +00:00
Server.h Add SYSTEM STOP LISTEN query (#51016) 2023-07-26 19:58:41 +02:00
users.xml Merge pull request #40713 from ClickHouse/remove-useless-line 2022-09-11 09:53:30 +03:00
users.yaml.example Update examples and remove obsolete embedded dictionaries from configs 2022-04-03 01:21:48 +02:00