diff --git a/config.yaml b/config.yaml index b3da5630..e9d747ef 100644 --- a/config.yaml +++ b/config.yaml @@ -348,3 +348,12 @@ options: . If not provided, leave the option unconfigured which enables all of the above. + worker-multiplier: + type: float + default: + description: | + The CPU core multiplier to use when configuring worker processes for + Horizon. By default, the number of workers for each daemon is set to + twice the number of CPU cores a service unit has. When deployed in + a LXD container, this default value will be capped to 4 workers + unless this configuration option is set. diff --git a/hooks/horizon_utils.py b/hooks/horizon_utils.py index c5014e76..0af36725 100644 --- a/hooks/horizon_utils.py +++ b/hooks/horizon_utils.py @@ -98,12 +98,14 @@ CONFIG_FILES = OrderedDict([ }), (APACHE_CONF, { 'hook_contexts': [horizon_contexts.HorizonContext(), - context.SyslogContext()], + context.SyslogContext(), + context.WSGIWorkerConfigContext()], 'services': ['apache2', 'memcached'], }), (APACHE_24_CONF, { 'hook_contexts': [horizon_contexts.HorizonContext(), - context.SyslogContext()], + context.SyslogContext(), + context.WSGIWorkerConfigContext()], 'services': ['apache2', 'memcached'], }), (APACHE_SSL, { diff --git a/templates/icehouse/openstack-dashboard.conf b/templates/icehouse/openstack-dashboard.conf index 634cddae..28a1dc03 100644 --- a/templates/icehouse/openstack-dashboard.conf +++ b/templates/icehouse/openstack-dashboard.conf @@ -1,5 +1,5 @@ WSGIScriptAlias {{ webroot }} /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi -WSGIDaemonProcess horizon user=horizon group=horizon processes=3 threads=10 +WSGIDaemonProcess horizon user=horizon group=horizon processes={{ processes }} threads=10 WSGIProcessGroup horizon Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static/ Alias /horizon/static /usr/share/openstack-dashboard/openstack_dashboard/static/ diff --git a/templates/newton/openstack-dashboard.conf b/templates/newton/openstack-dashboard.conf index 634cddae..28a1dc03 100644 --- a/templates/newton/openstack-dashboard.conf +++ b/templates/newton/openstack-dashboard.conf @@ -1,5 +1,5 @@ WSGIScriptAlias {{ webroot }} /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi -WSGIDaemonProcess horizon user=horizon group=horizon processes=3 threads=10 +WSGIDaemonProcess horizon user=horizon group=horizon processes={{ processes }} threads=10 WSGIProcessGroup horizon Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static/ Alias /horizon/static /usr/share/openstack-dashboard/openstack_dashboard/static/ diff --git a/templates/ocata/openstack-dashboard.conf b/templates/ocata/openstack-dashboard.conf index 81055d06..e22b3cfa 100644 --- a/templates/ocata/openstack-dashboard.conf +++ b/templates/ocata/openstack-dashboard.conf @@ -1,5 +1,5 @@ WSGIScriptAlias {{ webroot }} /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi -WSGIDaemonProcess horizon user=www-data group=www-data processes=3 threads=10 +WSGIDaemonProcess horizon user=www-data group=www-data processes={{ processes }} threads=10 WSGIProcessGroup horizon Alias /static /var/lib/openstack-dashboard/static/ Alias /horizon/static /var/lib/openstack-dashboard/static/ diff --git a/templates/pike/openstack-dashboard.conf b/templates/pike/openstack-dashboard.conf index 053625fd..99feddfb 100644 --- a/templates/pike/openstack-dashboard.conf +++ b/templates/pike/openstack-dashboard.conf @@ -1,5 +1,5 @@ WSGIScriptAlias {{ webroot }} /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi -WSGIDaemonProcess horizon user=horizon group=horizon processes=3 threads=10 +WSGIDaemonProcess horizon user=horizon group=horizon processes={{ processes }} threads=10 WSGIProcessGroup horizon Alias /static /var/lib/openstack-dashboard/static/ Alias /horizon/static /var/lib/openstack-dashboard/static/