From 7704d94c7420e8aba451a0f86c58e46eec99ef74 Mon Sep 17 00:00:00 2001 From: Bjoern Teipel Date: Thu, 28 Apr 2016 15:30:56 -0500 Subject: [PATCH] Add support to tune the keystone apache MPM settings This fix adds support to tune the apache MPM server settings in case more HTTP threads are needed. New overrides have been predefined in order to use the Ubuntu default settings: keystone_httpd_mpm_backend: event keystone_httpd_mpm_start_servers: 2 keystone_httpd_mpm_min_spare_threads: 25 keystone_httpd_mpm_max_spare_threads: 75 keystone_httpd_mpm_thread_limit: 64 keystone_httpd_mpm_thread_child: 25 keystone_httpd_mpm_max_requests: 150 keystone_httpd_mpm_max_conn_child: 0 Change-Id: Ieaad4d2b3c62a5b59e1fa597816ab1b4c2fc3cb1 Closes-Bug: #1576399 --- defaults/main.yml | 10 ++++++++++ ...he-mpm-tunable-support-1c72f2f99cd502bc.yaml | 17 +++++++++++++++++ tasks/keystone_apache.yml | 3 ++- templates/keystone-httpd-mpm.conf.j2 | 9 +++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/os-keystone-apache-mpm-tunable-support-1c72f2f99cd502bc.yaml create mode 100644 templates/keystone-httpd-mpm.conf.j2 diff --git a/defaults/main.yml b/defaults/main.yml index 3173c11c..e9d4de7a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -164,6 +164,16 @@ keystone_apache_serversignature: "Off" keystone_wsgi_threads: 1 keystone_wsgi_processes: "{{ ansible_processor_vcpus | default (1) * 2 }}" +## Apache MPM tunables +keystone_httpd_mpm_backend: event +keystone_httpd_mpm_start_servers: 2 +keystone_httpd_mpm_min_spare_threads: 25 +keystone_httpd_mpm_max_spare_threads: 75 +keystone_httpd_mpm_thread_limit: 64 +keystone_httpd_mpm_thread_child: 25 +keystone_httpd_mpm_max_requests: 150 +keystone_httpd_mpm_max_conn_child: 0 + # set keystone_ssl to true to enable SSL configuration on the keystone containers keystone_ssl: false keystone_ssl_cert: /etc/ssl/certs/keystone.pem diff --git a/releasenotes/notes/os-keystone-apache-mpm-tunable-support-1c72f2f99cd502bc.yaml b/releasenotes/notes/os-keystone-apache-mpm-tunable-support-1c72f2f99cd502bc.yaml new file mode 100644 index 00000000..e74080ef --- /dev/null +++ b/releasenotes/notes/os-keystone-apache-mpm-tunable-support-1c72f2f99cd502bc.yaml @@ -0,0 +1,17 @@ +--- +features: + - | + Apache MPM tunable support has been added to the os-keystone + role in order to allow MPM thread tuning. + Default values reflect the current Ubuntu default settings: + + .. code-block:: yaml + + keystone_httpd_mpm_backend: event + keystone_httpd_mpm_start_servers: 2 + keystone_httpd_mpm_min_spare_threads: 25 + keystone_httpd_mpm_max_spare_threads: 75 + keystone_httpd_mpm_thread_limit: 64 + keystone_httpd_mpm_thread_child: 25 + keystone_httpd_mpm_max_requests: 150 + keystone_httpd_mpm_max_conn_child: 0 diff --git a/tasks/keystone_apache.yml b/tasks/keystone_apache.yml index 0b750963..2d75d81f 100644 --- a/tasks/keystone_apache.yml +++ b/tasks/keystone_apache.yml @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Drop apache2 ports file +- name: Drop apache2 config files template: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -22,6 +22,7 @@ with_items: - { src: "keystone-ports.conf.j2", dest: "/etc/apache2/ports.conf" } - { src: "keystone-httpd.conf.j2", dest: "/etc/apache2/sites-available/keystone-httpd.conf" } + - { src: "keystone-httpd-mpm.conf.j2", dest: "/etc/apache2/mods-available/mpm_{{ keystone_httpd_mpm_backend }}.conf" } notify: - Restart Apache tags: diff --git a/templates/keystone-httpd-mpm.conf.j2 b/templates/keystone-httpd-mpm.conf.j2 new file mode 100644 index 00000000..925b1fbb --- /dev/null +++ b/templates/keystone-httpd-mpm.conf.j2 @@ -0,0 +1,9 @@ + + StartServers {{ keystone_httpd_mpm_start_servers }} + MinSpareThreads {{ keystone_httpd_mpm_min_spare_threads }} + MaxSpareThreads {{ keystone_httpd_mpm_max_spare_threads }} + ThreadLimit {{ keystone_httpd_mpm_thread_limit }} + ThreadsPerChild {{ keystone_httpd_mpm_thread_child }} + MaxRequestWorkers {{ keystone_httpd_mpm_max_requests }} + MaxConnectionsPerChild {{ keystone_httpd_mpm_max_conn_child }} +