Configure trove_conductor_workers in os_trove

Configure trove_conductor_workers by calculating the default value.
Similar to other services worker threads, the default value for
trove_conductor_workers is half the number of vcpus on the machine.

Also added capping of worker threads for trove.

Change-Id: If853b0e1e45b7137572df8a1123273539343c83e
Closes-Bug: #1664639
This commit is contained in:
Ravi Gummadi 2017-02-17 02:17:13 -05:00
parent 82eddc31c8
commit fdd59ffe60
3 changed files with 12 additions and 8 deletions

View File

@ -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

View File

@ -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. #}

View File

@ -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 %}