From ed43477167116e4db67274f2d465f17cb12e460d Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 8 Nov 2023 18:48:23 +0000 Subject: [PATCH] Set memory limits for user slices on the dev server --- cookbooks/dev/recipes/default.rb | 13 +++++++++++++ cookbooks/dev/templates/default/user-slice.conf.erb | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 cookbooks/dev/templates/default/user-slice.conf.erb diff --git a/cookbooks/dev/recipes/default.rb b/cookbooks/dev/recipes/default.rb index 7eed5a159..472377043 100644 --- a/cookbooks/dev/recipes/default.rb +++ b/cookbooks/dev/recipes/default.rb @@ -596,3 +596,16 @@ end apache_site "ooc.openstreetmap.org" do template "apache.ooc.erb" end + +directory "/etc/systemd/system/user-.slice.d" do + owner "root" + group "root" + mode "0755" +end + +template "/etc/systemd/system/user-.slice.d/99-chef.conf" do + source "user-slice.conf.erb" + owner "root" + group "root" + mode "0644" +end diff --git a/cookbooks/dev/templates/default/user-slice.conf.erb b/cookbooks/dev/templates/default/user-slice.conf.erb new file mode 100644 index 000000000..47d8a0622 --- /dev/null +++ b/cookbooks/dev/templates/default/user-slice.conf.erb @@ -0,0 +1,3 @@ +[Slice] +MemoryHigh=80% +MemoryMax=90% -- 2.39.5