From 7d8105ed5531efab1dddf37845e732d4c66ad01e Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Wed, 25 Nov 2015 19:47:02 +0000 Subject: [PATCH] Implement tunable heat api and engine worker overrides This patch introduces an override for the number of Heat engine and Heat API workers: - heat_engine_workers - heat_api_workers 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: I1ecb4951fe8336d9ef86ef9d5c8c21105a299096 --- playbooks/roles/os_heat/defaults/main.yml | 4 ++++ playbooks/roles/os_heat/templates/heat.conf.j2 | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/playbooks/roles/os_heat/defaults/main.yml b/playbooks/roles/os_heat/defaults/main.yml index 8fb16385b6..6c60098af1 100644 --- a/playbooks/roles/os_heat/defaults/main.yml +++ b/playbooks/roles/os_heat/defaults/main.yml @@ -146,6 +146,10 @@ heat_watch_port: 8003 heat_watch_server_uri: "{{ heat_watch_proto }}://{{ external_lb_vip_address }}:{{ heat_watch_port }}" heat_watch_server_url: "{{ heat_watch_server_uri }}" +# If the following variables are unset in user_variables, the value set will be half the number of available VCPUs +# heat_engine_workers: 4 +# heat_api_workers: 4 + ## Plugin dirs heat_plugin_dirs: - /usr/lib/heat diff --git a/playbooks/roles/os_heat/templates/heat.conf.j2 b/playbooks/roles/os_heat/templates/heat.conf.j2 index ffb1e68043..a6d9a2c393 100644 --- a/playbooks/roles/os_heat/templates/heat.conf.j2 +++ b/playbooks/roles/os_heat/templates/heat.conf.j2 @@ -1,5 +1,8 @@ # {{ ansible_managed }} +{% set _api_threads = ansible_processor_vcpus|default(2) // 2 %} +{% set api_threads = _api_threads if _api_threads > 0 else 1 %} + [DEFAULT] verbose = {{ verbose }} debug = {{ debug }} @@ -20,6 +23,8 @@ trusts_delegated_roles = {{ heat_trusts_delegated_roles | join(',') }} auth_encryption_key = {{ heat_auth_encryption_key }} +num_engine_workers = {{ heat_engine_workers | default(api_threads) }} + ## RPC Backend rpc_backend = {{ heat_rpc_backend }} @@ -51,6 +56,7 @@ auth_uri = {{ keystone_service_internalurl }} [heat_api] bind_port = {{ heat_service_port }} +workers = {{ heat_api_workers | default(api_threads) }} [heat_api_cfn] bind_port = {{ heat_cfn_service_port }}