From: Tom Hughes Date: Wed, 12 Apr 2023 17:07:34 +0000 (+0100) Subject: Apply memory limits to apache servers to avoid memory exhaustion X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/f24e766d33bd33ed6f4557b2998674453e9c1fe2?ds=sidebyside Apply memory limits to apache servers to avoid memory exhaustion --- diff --git a/cookbooks/apache/metadata.rb b/cookbooks/apache/metadata.rb index f6176ee8b..4aca8107d 100644 --- a/cookbooks/apache/metadata.rb +++ b/cookbooks/apache/metadata.rb @@ -9,3 +9,4 @@ supports "ubuntu" depends "munin" depends "prometheus" depends "ssl" +depends "systemd" diff --git a/cookbooks/apache/recipes/default.rb b/cookbooks/apache/recipes/default.rb index b1e808929..8f217d364 100644 --- a/cookbooks/apache/recipes/default.rb +++ b/cookbooks/apache/recipes/default.rb @@ -54,6 +54,13 @@ template "/etc/apache2/ports.conf" do mode "644" end +systemd_service "apache2" do + dropin "chef" + memory_high "50%" + memory_max "75%" + notifies :restart, "service[apache2]" +end + service "apache2" do action [:enable, :start] retries 2