]> git.openstreetmap.org Git - chef.git/commitdiff
Apply memory limits to apache servers to avoid memory exhaustion
authorTom Hughes <tom@compton.nu>
Wed, 12 Apr 2023 17:07:34 +0000 (18:07 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 12 Apr 2023 17:09:05 +0000 (18:09 +0100)
cookbooks/apache/metadata.rb
cookbooks/apache/recipes/default.rb

index f6176ee8b8183d8a34767b6fa9d99bd38e6e56c0..4aca8107d528d09a2900b92985c278e293f9ff72 100644 (file)
@@ -9,3 +9,4 @@ supports          "ubuntu"
 depends           "munin"
 depends           "prometheus"
 depends           "ssl"
 depends           "munin"
 depends           "prometheus"
 depends           "ssl"
+depends           "systemd"
index b1e80892908bbed6ab8a9222bc0784afd55c1f67..8f217d36478d55a0a06e72fca1948c6d9f305872 100644 (file)
@@ -54,6 +54,13 @@ template "/etc/apache2/ports.conf" do
   mode "644"
 end
 
   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
 service "apache2" do
   action [:enable, :start]
   retries 2