From 744d6f99424491429b0a307c9f85e2ae50a8826a Mon Sep 17 00:00:00 2001 From: liyuenan Date: Thu, 16 Feb 2017 09:08:52 +0800 Subject: FIX access database failed JIRA: COMPASS-521 Use a dynamic value to set number of workers for Openstack API service when the number of cpu more than 4. Change-Id: Ic6482cfad9b5eba8fad9e56ea1a33f65e8c71001 Signed-off-by: liyuenan --- deploy/adapters/ansible/roles/heat/templates/heat.j2 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'deploy/adapters/ansible/roles/heat') diff --git a/deploy/adapters/ansible/roles/heat/templates/heat.j2 b/deploy/adapters/ansible/roles/heat/templates/heat.j2 index a7856103..d73bd70b 100644 --- a/deploy/adapters/ansible/roles/heat/templates/heat.j2 +++ b/deploy/adapters/ansible/roles/heat/templates/heat.j2 @@ -3,6 +3,11 @@ {% set _ = memcached_servers.append('%s:11211'% host) %} {% endfor %} {% set memcached_servers = memcached_servers|join(',') %} +{% if ansible_processor_vcpus > 5 %} +{% set api_workers = ansible_processor_vcpus // 5 %} +{% else %} +{% set api_workers = 1 %} +{% endif %} [DEFAULT] heat_metadata_server_url = http://{{ internal_vip.ip }}:8000 @@ -12,14 +17,10 @@ log_dir = /var/log/heat stack_domain_admin = heat_domain_admin stack_domain_admin_password = {{ HEAT_PASS }} stack_user_domain_name = heat -{% if ansible_processor_vcpus > 30 %} -num_engine_workers = 30 -{% endif %} +num_engine_workers = {{ api_workers}} [heat_api] -{% if ansible_processor_vcpus > 30 %} -workers = 30 -{% endif %} +workers = {{ api_workers }} [database] connection = mysql://heat:{{ HEAT_DBPASS }}@{{ db_host }}/heat -- cgit 1.2.3-korg