Make apache nproc rlimit not depend on role memberships
authorPeter Palfrader <peter@palfrader.org>
Sun, 15 Sep 2019 07:56:42 +0000 (09:56 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sun, 15 Sep 2019 07:56:42 +0000 (09:56 +0200)
hieradata/nodes/beach.debian.org.yaml
hieradata/nodes/buxtehude.debian.org.yaml
modules/apache2/manifests/init.pp
modules/apache2/templates/resource-limits.erb

index 977990d..a5723bc 100644 (file)
@@ -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
index 212974c..7e04deb 100644 (file)
@@ -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
index dfa4b59..dc19958 100644 (file)
 #                                  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'),
index d4da647..5673c0d 100644 (file)
@@ -5,4 +5,4 @@
 
 RLimitCPU 180
 RLimitMEM <%= @memlimit %>
-RLimitNPROC <%= @proclimit %>
+RLimitNPROC <%= @rlimitnproc %>