Provide for RAM-constrained environments
authorJiri Stransky <jistr@redhat.com>
Wed, 21 Sep 2016 11:53:19 +0000 (13:53 +0200)
committerJiri Stransky <jistr@redhat.com>
Wed, 21 Sep 2016 13:14:20 +0000 (15:14 +0200)
We hit problems in environments which don't have a lot of RAM (e.g. dev
envs, could be also CI) that Apache ate too much memory due to
too many worker processes being spawned.

This commit allows customizing the Apache MaxRequestWorkers and
ServerLimit directives via Heat parameters. The default stays 256 as
that's the default in the Puppet module, to be suited for production
environments with powerful machines. Also low-memory-usage.yaml
environment file is added, which can be used to make dev/test/CI
overclouds less memory hungry, where the limits are now set to 32.

Change-Id: Ibcf1d9c3326df8bb5b380066166c4ae3c4bf8d96
Co-Authored-By: Carlos Camacho <ccamacho@redhat.com>
Closes-Bug: #1619205

environments/low-memory-usage.yaml [new file with mode: 0644]
puppet/services/apache.yaml

diff --git a/environments/low-memory-usage.yaml b/environments/low-memory-usage.yaml
new file mode 100644 (file)
index 0000000..2e496f8
--- /dev/null
@@ -0,0 +1,14 @@
+# Lower the memory usage of overcloud.
+parameter_defaults:
+  CeilometerWorkers: 1
+  CinderWorkers: 1
+  GlanceWorkers: 1
+  HeatWorkers: 1
+  KeystoneWorkers: 1
+  NeutronWorkers: 1
+  NovaWorkers: 1
+  SaharaWorkers: 1
+  SwiftWorkers: 1
+
+  ApacheMaxRequestWorkers: 32
+  ApacheServerLimit: 32
index 7595e4c..c979201 100644 (file)
@@ -5,6 +5,14 @@ description: >
   automatically via other services which run via Apache.
 
 parameters:
+  ApacheMaxRequestWorkers:
+    default: 256
+    description: Maximum number of simultaneously processed requests.
+    type: number
+  ApacheServerLimit:
+    default: 256
+    description: Maximum number of Apache processes.
+    type: number
   ServiceNetMap:
     default: {}
     description: Mapping of service_name -> network name. Typically set
@@ -38,5 +46,7 @@ outputs:
             template: "NETWORK_subnet"
             params:
               NETWORK: {get_param: [ServiceNetMap, ApacheNetwork]}
+        apache::mod::prefork::maxclients: { get_param: ApacheMaxRequestWorkers }
+        apache::mod::prefork::serverlimit: { get_param: ApacheServerLimit }
         apache::mod::remoteip::proxy_ips:
           - "%{hiera('apache_remote_proxy_ips_network')}"