Implement tunable Horizon/Apache processes/threads overrides

This patch introduces an override for the number of Apache processes
and threads for Horizon:
 - horizon_wsgi_processes
 - horizon_wsgi_threads

The values may be set in /etc/openstack_deploy/user_variables.yml
and if they are unset, half the number of available vCPU's will be
used instead.

Implements: blueprint gate-split
Change-Id: Ie608ef66b8979a466e72c6085c9afa6ab95cc6ff
This commit is contained in:
Jesse Pretorius 2015-11-25 19:54:34 +00:00
parent 962229e839
commit 58205d7604
2 changed files with 6 additions and 2 deletions

View File

@ -75,6 +75,9 @@ horizon_enable_password_retrieve: False
horizon_can_set_password: False
horizon_enable_cinder_backup: False
# If the following variables are unset in user_variables, the value set will be half the number of available VCPUs
# horizon_wsgi_processes: 4
# horizon_wsgi_threads: 4
## Horizon SSL
horizon_ssl_cert: /etc/ssl/certs/horizon.pem

View File

@ -1,6 +1,7 @@
# {{ ansible_managed }}
{% set threads = ansible_processor_vcpus // 2 %}
{% set _wsgi_threads = ansible_processor_vcpus | default(2) // 2 %}
{% set wsgi_threads = _wsgi_threads if _wsgi_threads > 0 else 1 %}
<VirtualHost *:80>
ServerName {{ horizon_server_name }}
@ -30,7 +31,7 @@
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
WSGIScriptAlias / {{ horizon_lib_wsgi_file }}
WSGIDaemonProcess horizon user={{ horizon_system_user_name }} group={{ horizon_system_group_name }} processes={{ ansible_processor_cores }} threads={{ threads if threads > 0 else 1 }}
WSGIDaemonProcess horizon user={{ horizon_system_user_name }} group={{ horizon_system_group_name }} processes={{ horizon_wsgi_processes | default(wsgi_threads) }} threads={{ horizon_wsgi_threads | default(wsgi_threads) }}
WSGIProcessGroup horizon
WSGIApplicationGroup horizon