From: Peter Palfrader Date: Sun, 15 Sep 2019 07:56:42 +0000 (+0200) Subject: Make apache nproc rlimit not depend on role memberships X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=a708f87b1b3885ab61f4017722f614dd8b7eaeb6;p=mirror%2Fdsa-puppet.git Make apache nproc rlimit not depend on role memberships --- diff --git a/hieradata/nodes/beach.debian.org.yaml b/hieradata/nodes/beach.debian.org.yaml index 977990d13..a5723bc01 100644 --- a/hieradata/nodes/beach.debian.org.yaml +++ b/hieradata/nodes/beach.debian.org.yaml @@ -3,3 +3,5 @@ classes: - roles::bugs_mirror apache2::smaller_number_of_threads: true +# debbugs cgis like to fork and don't deal well with EAGAIN +apache2::rlimitnproc: 450 diff --git a/hieradata/nodes/buxtehude.debian.org.yaml b/hieradata/nodes/buxtehude.debian.org.yaml index 212974c57..7e04deb1b 100644 --- a/hieradata/nodes/buxtehude.debian.org.yaml +++ b/hieradata/nodes/buxtehude.debian.org.yaml @@ -1,2 +1,4 @@ --- apache2::smaller_number_of_threads: true +# debbugs cgis like to fork and don't deal well with EAGAIN +apache2::rlimitnproc: 450 diff --git a/modules/apache2/manifests/init.pp b/modules/apache2/manifests/init.pp index dfa4b59bc..dc1995872 100644 --- a/modules/apache2/manifests/init.pp +++ b/modules/apache2/manifests/init.pp @@ -10,8 +10,10 @@ # serving static/cheap content. If the host is very # script heavy (say the bug tracking system), set this # to reduce the number of worker threads. +# @param rlimitnproc A resource limit for number of processes. The default is usually fine. class apache2( - Boolean $smaller_number_of_threads = false + Boolean $smaller_number_of_threads = false, + Integer $rlimitnproc = 256, ) { include webserver @@ -60,12 +62,6 @@ class apache2( } else { $memlimit = 192 * 1024 * 1024 } - # debbugs cgis like to fork and don't deal well with EAGAIN - if has_role('bugs_base') { - $proclimit = 450 - } else { - $proclimit = 256 - } apache2::config { 'resource-limits': content => template('apache2/resource-limits.erb'), diff --git a/modules/apache2/templates/resource-limits.erb b/modules/apache2/templates/resource-limits.erb index d4da647dc..5673c0de3 100644 --- a/modules/apache2/templates/resource-limits.erb +++ b/modules/apache2/templates/resource-limits.erb @@ -5,4 +5,4 @@ RLimitCPU 180 RLimitMEM <%= @memlimit %> -RLimitNPROC <%= @proclimit %> +RLimitNPROC <%= @rlimitnproc %>