Cap the number of worker threads

Users can configure the number of worker threads however when it's
not specified the calculated number of workers can get too large on
hosts with a large number of CPUs.

Change-Id: If0e1f051ecdc0e1cc9713c7300e72e0748e01737
This commit is contained in:
Ravi Gummadi 2017-02-22 07:16:34 -05:00
parent beba04141b
commit ea00eb26f2
3 changed files with 9 additions and 7 deletions

View File

@ -153,9 +153,9 @@ cinder_service_backup_metadata_version: 2
cinder_swift_catalog_info: "object-store:swift:internalURL"
# If ``cinder_osapi_volume_workers`` is unset the system will use half the number of
# available VCPUS to compute the number of api workers to use.
# cinder_osapi_volume_workers: 16
## Cap the maximun number of threads / workers when a user value is unspecified.
cinder_osapi_volume_workers_max: 16
cinder_osapi_volume_workers: "{{ [[ansible_processor_vcpus|default(2) // 2, 1] | max, cinder_osapi_volume_workers_max] | min }}"
## Cinder iscsi
cinder_iscsi_helper: tgtadm

View File

@ -0,0 +1,5 @@
---
features:
- Capping the default value for the variable ``cinder_osapi_volume_workers``
to 16 when the user doesn't configure this variable. Default value is half
the number of vCPUs available on the machine with a capping value of 16.

View File

@ -1,8 +1,5 @@
# {{ ansible_managed }}
{% set _api_threads = ansible_processor_vcpus|default(2) // 2 %}
{% set api_threads = _api_threads if _api_threads > 0 else 1 %}
[DEFAULT]
# Disable stderr logging
use_stderr = False
@ -10,7 +7,7 @@ debug = {{ debug }}
fatal_deprecations = {{ cinder_fatal_deprecations }}
my_ip = {{ cinder_management_address }}
osapi_volume_workers = {{ cinder_osapi_volume_workers | default(api_threads) }}
osapi_volume_workers = {{ cinder_osapi_volume_workers }}
rootwrap_config = /etc/cinder/rootwrap.conf
api_paste_config = /etc/cinder/api-paste.ini