diff --git a/defaults/main.yml b/defaults/main.yml index 4b2b22fe..5644f037 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/releasenotes/notes/capping_cinder_osapi_volume_workers-db32afcf7615b05b.yaml b/releasenotes/notes/capping_cinder_osapi_volume_workers-db32afcf7615b05b.yaml new file mode 100644 index 00000000..0f33f8e5 --- /dev/null +++ b/releasenotes/notes/capping_cinder_osapi_volume_workers-db32afcf7615b05b.yaml @@ -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. diff --git a/templates/cinder.conf.j2 b/templates/cinder.conf.j2 index 5207c045..51521402 100644 --- a/templates/cinder.conf.j2 +++ b/templates/cinder.conf.j2 @@ -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