modified the heat charm to accomodate the workers-mutiplier option

Heat charm was missing this functionality and this patch is to add
this feature. We were trying to deploy this charm in a lxc
container on a host machine with 72 cores. In end up creating 144
process with heat-engine and heat-api.

This patch will provide the option to limit the number of worker
process in case of high number of cores in a host.

Enable it for icehouse, kilo, liberty and mitaka.

Change-Id: I811f0a91e1ff9a6d95e80a4a40be063d7d047c7e
This commit is contained in:
Narinder Gupta 2016-08-11 12:10:03 -05:00
parent 5651544b98
commit 93045f3124
6 changed files with 20 additions and 0 deletions

View File

@ -217,4 +217,11 @@ options:
description: |
Apply system hardening. Supports a space-delimited list of modules
to run. Supported modules currently include os, ssh, apache and mysql.
worker-multiplier:
type: float
default: 2.0
description: |
The CPU core multiplier to use when configuring worker processes for
Heat. By default, the number of workers for each daemon is set to
twice the number of CPU cores a service unit has.

View File

@ -101,6 +101,7 @@ CONFIG_FILES = OrderedDict([
InstanceUserContext(),
context.SyslogContext(),
context.LogLevelContext(),
context.WorkerConfigContext(),
context.BindHostContext()]
}),
(HEAT_API_PASTE, {

View File

@ -12,6 +12,7 @@ environment_dir=/etc/heat/environment.d
deferred_auth_method=password
host=heat
auth_encryption_key={{ encryption_key }}
num_engine_workers = {{ workers }}
{% if database_host -%}
# < Icehouse db config
@ -70,6 +71,7 @@ bind_port={{ api_listen_port }}
{% else -%}
bind_port=8004
{% endif %}
workers = {{ workers }}
[heat_api_cfn]
{% if api_cfn_listen_port -%}
@ -77,3 +79,4 @@ bind_port={{ api_cfn_listen_port }}
{% else -%}
bind_port=8000
{% endif %}
workers = {{ workers }}

View File

@ -13,6 +13,7 @@ deferred_auth_method = trusts
stack_domain_admin = heat_domain_admin
stack_domain_admin_password = {{ heat_domain_admin_passwd }}
stack_user_domain_name = heat
num_engine_workers = {{ workers }}
{% if auth_host -%}
[keystone_authtoken]
@ -43,6 +44,7 @@ bind_port={{ api_listen_port }}
{% else -%}
bind_port=8004
{% endif %}
workers = {{ workers }}
[heat_api_cfn]
bind_host = {{ bind_host }}
@ -51,6 +53,7 @@ bind_port={{ api_cfn_listen_port }}
{% else -%}
bind_port=8000
{% endif %}
workers = {{ workers }}
{% include "section-rabbitmq-oslo" %}

View File

@ -13,6 +13,7 @@ deferred_auth_method = trusts
stack_domain_admin = heat_domain_admin
stack_domain_admin_password = {{ heat_domain_admin_passwd }}
stack_user_domain_name = heat
num_engine_workers = {{ workers }}
{% if auth_host -%}
[keystone_authtoken]
@ -56,6 +57,7 @@ bind_port={{ api_listen_port }}
{% else -%}
bind_port=8004
{% endif %}
workers = {{ workers }}
[heat_api_cfn]
bind_host = {{ bind_host }}
@ -64,6 +66,7 @@ bind_port={{ api_cfn_listen_port }}
{% else -%}
bind_port=8000
{% endif %}
workers = {{ workers }}
{% include "section-rabbitmq-oslo" %}

View File

@ -13,6 +13,7 @@ deferred_auth_method = trusts
stack_domain_admin = heat_domain_admin
stack_domain_admin_password = {{ heat_domain_admin_passwd }}
stack_user_domain_name = heat
num_engine_workers = {{ workers }}
{% if auth_host -%}
{% include "section-keystone-authtoken-mitaka" %}
@ -47,6 +48,7 @@ bind_port={{ api_listen_port }}
{% else -%}
bind_port=8004
{% endif %}
workers = {{ workers }}
[heat_api_cfn]
bind_host = {{ bind_host }}
@ -55,6 +57,7 @@ bind_port={{ api_cfn_listen_port }}
{% else -%}
bind_port=8000
{% endif %}
workers = {{ workers }}
{% include "section-rabbitmq-oslo" %}