From 17b4748e4e3f75420dd802fc26217892074381b3 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Fri, 9 Oct 2015 15:34:17 +0000 Subject: [PATCH] Switch proxies to use the mpm event module instead of prefork. --- roles/httpd/proxy/files/00-mpm.conf | 18 ++++++++++++++++++ roles/httpd/proxy/tasks/main.yml | 8 ++++++++ roles/httpd/proxy/templates/httpd.conf.j2 | 4 ++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 roles/httpd/proxy/files/00-mpm.conf diff --git a/roles/httpd/proxy/files/00-mpm.conf b/roles/httpd/proxy/files/00-mpm.conf new file mode 100644 index 0000000000..f349d67269 --- /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 ff45c2a5d9..45140d9e90 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 2d69004030..77fb1987a1 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