summaryrefslogtreecommitdiffstats
path: root/roles/httpd/proxy
diff options
context:
space:
mode:
authorKevin Fenzi <kevin@scrye.com>2015-10-09 15:34:17 +0000
committerKevin Fenzi <kevin@scrye.com>2015-10-09 15:34:17 +0000
commit17b4748e4e3f75420dd802fc26217892074381b3 (patch)
tree64b4f2b26de27bf463cb3bda27a368693a4ead5c /roles/httpd/proxy
parent2be1e05107b64b798651971c7a64a0300ee0f51f (diff)
downloadansible-17b4748e4e3f75420dd802fc26217892074381b3.tar.gz
ansible-17b4748e4e3f75420dd802fc26217892074381b3.tar.xz
ansible-17b4748e4e3f75420dd802fc26217892074381b3.zip
Switch proxies to use the mpm event module instead of prefork.
Diffstat (limited to 'roles/httpd/proxy')
-rw-r--r--roles/httpd/proxy/files/00-mpm.conf18
-rw-r--r--roles/httpd/proxy/tasks/main.yml8
-rw-r--r--roles/httpd/proxy/templates/httpd.conf.j24
3 files changed, 28 insertions, 2 deletions
diff --git a/roles/httpd/proxy/files/00-mpm.conf b/roles/httpd/proxy/files/00-mpm.conf
new file mode 100644
index 000000000..f349d6726
--- /dev/null
+++ b/roles/httpd/proxy/files/00-mpm.conf
@@ -0,0 +1,18 @@
+# Select the MPM module which should be used by uncommenting exactly
+# one of the following LoadModule lines:
+
+# prefork MPM: Implements a non-threaded, pre-forking web server
+# See: http://httpd.apache.org/docs/2.4/mod/prefork.html
+#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
+
+# worker MPM: Multi-Processing Module implementing a hybrid
+# multi-threaded multi-process web server
+# See: http://httpd.apache.org/docs/2.4/mod/worker.html
+#
+#LoadModule mpm_worker_module modules/mod_mpm_worker.so
+
+# event MPM: A variant of the worker MPM with the goal of consuming
+# threads only for connections with active processing
+# See: http://httpd.apache.org/docs/2.4/mod/event.html
+#
+LoadModule mpm_event_module modules/mod_mpm_event.so
diff --git a/roles/httpd/proxy/tasks/main.yml b/roles/httpd/proxy/tasks/main.yml
index ff45c2a5d..45140d9e9 100644
--- a/roles/httpd/proxy/tasks/main.yml
+++ b/roles/httpd/proxy/tasks/main.yml
@@ -31,6 +31,14 @@
- httpd
- httpd/proxy
+- name: set the apache mpm to use event MPM
+ copy: src=00-mpm.conf dest=/etc/httpd/conf.modules.d/00-mpm.conf
+ notify:
+ - restart httpd
+ tags:
+ - httpd
+ - httpd/proxy
+
- name: Install libsemanage-python so we can manage selinux with python...
yum: name=libsemanage-python state=installed
tags:
diff --git a/roles/httpd/proxy/templates/httpd.conf.j2 b/roles/httpd/proxy/templates/httpd.conf.j2
index 2d6900403..77fb1987a 100644
--- a/roles/httpd/proxy/templates/httpd.conf.j2
+++ b/roles/httpd/proxy/templates/httpd.conf.j2
@@ -106,8 +106,8 @@ KeepAliveTimeout 15
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
StartServers 150
-MinSpareServers 50
-MaxSpareServers 100
+#MinSpareServers 50
+#MaxSpareServers 100
ServerLimit {{ maxrequestworkers }}
MaxRequestWorkers {{ maxrequestworkers }}
MaxRequestsPerChild 10000