diff --git a/defaults/main.yml b/defaults/main.yml index 8d76b68..8b13e0e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -59,10 +59,13 @@ trove_swift_url: "{{ trove_service_publicuri_proto }}://{{ external_lb_vip_addre trove_neutron_url: "{{ trove_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ neutron_service_port }}/" trove_profiler_enabled: false -# If ``trove_api_workers`` is unset the system will use half the number of -# available VCPUS to compute the number of api workers to use. -# trove_api_workers: 16 -# trove_api_workers: 16 +## Cap the maximum number of threads / workers when a user value is unspecified. +trove_api_workers_max: 16 +trove_api_workers: "{{ [[ansible_processor_vcpus|default(2) // 2, 1] | max, trove_api_workers_max] | min }}" + +## Cap the maximum number of threads / workers when a user value is unspecified. +trove_conductor_workers_max: 16 +trove_conductor_workers: "{{ [[ansible_processor_vcpus|default(2) // 2, 1] | max, trove_conductor_workers_max] | min }}" # Name of the virtual env to deploy into trove_venv_tag: untagged @@ -88,7 +91,9 @@ trove_apache_log_level: info trove_apache_servertokens: "Prod" trove_apache_serversignature: "Off" trove_wsgi_threads: 1 -trove_wsgi_processes: "{{ ansible_processor_vcpus | default (1) * 2 }}" +## Cap the maximum number of processes when a user value is unspecified. +trove_wsgi_processes_max: 32 +trove_wsgi_processes: "{{ [[ansible_processor_vcpus|default(1), 1] | max * 2, trove_wsgi_processes_max] | min }}" # set trove_ssl to true to enable SSL configuration on the trove containers trove_ssl: false diff --git a/templates/trove-conductor.conf.j2 b/templates/trove-conductor.conf.j2 index 642c6b6..c5e385e 100644 --- a/templates/trove-conductor.conf.j2 +++ b/templates/trove-conductor.conf.j2 @@ -5,6 +5,7 @@ debug = {{ debug }} trove_auth_url = {{ trove_auth_url }} conductor_manager = trove.conductor.manager.Manager rpc_backend={{ trove_rpc_backend }} +trove_conductor_workers={{ trove_conductor_workers }} transport_url = rabbit://{% for host in trove_rabbitmq_servers.split(',') %}{{ trove_rabbitmq_userid }}:{{ trove_rabbitmq_password }}@{{ host }}:{{ trove_rabbitmq_port }}{% if not loop.last %},{% else %}/{{ trove_rabbitmq_vhost }}{% endif %}{% endfor %} {# There must be a blank line above or the following line will be appended to the previous. #} diff --git a/templates/trove.conf.j2 b/templates/trove.conf.j2 index 6d4827f..334543b 100644 --- a/templates/trove.conf.j2 +++ b/templates/trove.conf.j2 @@ -1,11 +1,9 @@ # {{ ansible_managed }} -{% set _api_threads = ansible_processor_vcpus|default(2) // 2 %} -{% set api_threads = _api_threads if _api_threads > 0 else 1 %} [DEFAULT] debug = {{ debug }} bind_host = {{ trove_service_host }} bind_port = {{ trove_service_port }} -trove_api_workers={{ trove_api_workers | default(api_threads) }} +trove_api_workers={{ trove_api_workers }} rpc_backend={{ trove_rpc_backend }} transport_url = rabbit://{% for host in trove_rabbitmq_servers.split(',') %}{{ trove_rabbitmq_userid }}:{{ trove_rabbitmq_password }}@{{ host }}:{{ trove_rabbitmq_port }}{% if not loop.last %},{% else %}/{{ trove_rabbitmq_vhost }}{% endif %}{% endfor %}