Fix inconsistent <service>Workers

Currently the <service>Workers parameters are implemented in different
ways according to services. Because of this, these parameters enforce
different type(number vs string) and behave differently for a specific
value such as 0. These are quite confusing for users.

This change introduces the standard implementation for all Workers
parameters so that the parameters behave consistently in all services.

This also introduces the following changes as side-effects.

- Outdated description of some workers parameter is removed. Currently
  workers are limited to a certain number(such as 12) even in a system
  with many CPU cores

- Default value of BarbicanWorkers is effectively lowered down to
  $::os_workers from $::processorcount, to use the consistent default
  workers for all services.

Change-Id: Ie7a12a297e00efebca017d51afb9bf9e8c56ee50
This commit is contained in:
Takashi Kajinami 2022-09-27 12:20:00 +09:00
parent 09e8ccac77
commit 190420f1bb
11 changed files with 71 additions and 60 deletions

View File

@ -123,8 +123,8 @@ parameters:
hidden: true hidden: true
BarbicanWorkers: BarbicanWorkers:
description: Set the number of workers for barbican::wsgi::apache description: Set the number of workers for barbican::wsgi::apache
default: '%{::processorcount}' default: 0
type: string type: number
Debug: Debug:
default: false default: false
description: Set to True to enable debugging on all services. description: Set to True to enable debugging on all services.
@ -163,6 +163,8 @@ parameters:
default: true default: true
conditions: conditions:
barbican_workers_set:
not: {equals : [{get_param: BarbicanWorkers}, 0]}
hsm_enabled: hsm_enabled:
or: or:
- {get_param: BarbicanPkcs11CryptoThalesEnabled} - {get_param: BarbicanPkcs11CryptoThalesEnabled}
@ -291,7 +293,10 @@ outputs:
params: params:
$NETWORK: {get_param: [ServiceNetMap, BarbicanApiNetwork]} $NETWORK: {get_param: [ServiceNetMap, BarbicanApiNetwork]}
barbican::wsgi::apache::ssl: {get_param: EnableInternalTLS} barbican::wsgi::apache::ssl: {get_param: EnableInternalTLS}
barbican::wsgi::apache::workers: {get_param: BarbicanWorkers} barbican::wsgi::apache::workers:
if:
- barbican_workers_set
- {get_param: BarbicanWorkers}
barbican::wsgi::apache::servername: barbican::wsgi::apache::servername:
str_replace: str_replace:
template: template:

View File

@ -76,9 +76,9 @@ parameters:
default: 'overcloud-cinder-api' default: 'overcloud-cinder-api'
type: string type: string
CinderWorkers: CinderWorkers:
type: string type: number
description: Set the number of workers for cinder::wsgi::apache description: Set the number of workers for cinder::wsgi::apache
default: '%{::os_workers}' default: 0
CinderApiPolicies: CinderApiPolicies:
description: | description: |
A hash of policies to configure for Cinder API. A hash of policies to configure for Cinder API.
@ -109,6 +109,8 @@ parameters:
conditions: conditions:
auth_cloud_name_set: auth_cloud_name_set:
not: {equals: [{get_param: AuthCloudName}, ""]} not: {equals: [{get_param: AuthCloudName}, ""]}
cinder_workers_set:
not: {equals : [{get_param: CinderWorkers}, 0]}
resources: resources:
ContainersCommon: ContainersCommon:
@ -244,7 +246,10 @@ outputs:
"Timeout TIMEOUT" "Timeout TIMEOUT"
params: params:
TIMEOUT: {get_param: CinderApiWsgiTimeout} TIMEOUT: {get_param: CinderApiWsgiTimeout}
cinder::wsgi::apache::workers: {get_param: CinderWorkers} cinder::wsgi::apache::workers:
if:
- cinder_workers_set
- {get_param: CinderWorkers}
cinder::api::sync_db: false cinder::api::sync_db: false
service_config_settings: service_config_settings:
rsyslog: rsyslog:

View File

@ -51,16 +51,12 @@ parameters:
type: string type: string
hidden: true hidden: true
GlanceWorkers: GlanceWorkers:
default: '' default: 0
description: | description: |
Number of API worker processes for Glance. If left unset (empty string), the Number of API worker processes for Glance. The default value will result
default value will result in the configuration being left unset and a in the configuration being left unset and a system-dependent default
system-dependent default value will be chosen (e.g.: number of value will be chosen.
processors). Please note that this will create a large number of type: number
processes on systems with a large number of CPUs resulting in excess
memory consumption. It is recommended that a suitable non-default value
be selected on such systems.
type: string
MonitoringSubscriptionGlanceApi: MonitoringSubscriptionGlanceApi:
default: 'overcloud-glance-api' default: 'overcloud-glance-api'
type: string type: string
@ -401,7 +397,7 @@ conditions:
- {get_param: NovaEnableRbdBackend} - {get_param: NovaEnableRbdBackend}
- {get_param: GlanceSparseUploadEnabled} - {get_param: GlanceSparseUploadEnabled}
glance_workers_set: glance_workers_set:
not: {equals : [{get_param: GlanceWorkers}, '']} not: {equals : [{get_param: GlanceWorkers}, 0]}
glance_multiple_locations: glance_multiple_locations:
or: or:
- {get_param: GlanceShowMultipleLocations} - {get_param: GlanceShowMultipleLocations}

View File

@ -68,9 +68,9 @@ parameters:
default: 'overcloud-gnocchi-metricd' default: 'overcloud-gnocchi-metricd'
type: string type: string
GnocchiMetricdWorkers: GnocchiMetricdWorkers:
default: '%{::os_workers}' default: 0
description: Number of workers for Gnocchi MetricD description: Number of workers for Gnocchi MetricD
type: string type: number
MetricProcessingDelay: MetricProcessingDelay:
default: 30 default: 30
description: Delay between processing metrics. description: Delay between processing metrics.
@ -83,6 +83,8 @@ parameters:
conditions: conditions:
nfs_backend_enabled: {equals: [{get_param: GnocchiNfsEnabled}, true]} nfs_backend_enabled: {equals: [{get_param: GnocchiNfsEnabled}, true]}
gnocchi_metricd_workers_set:
not: {equals: [{get_param: GnocchiMetricdWorkers}, 0]}
resources: resources:
@ -123,7 +125,10 @@ outputs:
config_settings: config_settings:
map_merge: map_merge:
- get_attr: [GnocchiServiceBase, role_data, config_settings] - get_attr: [GnocchiServiceBase, role_data, config_settings]
- gnocchi::metricd::workers: {get_param: GnocchiMetricdWorkers} - gnocchi::metricd::workers:
if:
- gnocchi_metricd_workers_set
- {get_param: GnocchiMetricdWorkers}
gnocchi::metricd::metric_processing_delay: {get_param: MetricProcessingDelay} gnocchi::metricd::metric_processing_delay: {get_param: MetricProcessingDelay}
monitoring_subscription: {get_param: MonitoringSubscriptionGnocchiMetricd} monitoring_subscription: {get_param: MonitoringSubscriptionGnocchiMetricd}
service_config_settings: service_config_settings:

View File

@ -139,9 +139,9 @@ parameters:
description: Set a token expiration time in seconds. description: Set a token expiration time in seconds.
type: number type: number
KeystoneWorkers: KeystoneWorkers:
type: string type: number
description: Set the number of workers for keystone::wsgi::apache description: Set the number of workers for keystone::wsgi::apache
default: '%{::os_workers_keystone}' default: 0
MonitoringSubscriptionKeystone: MonitoringSubscriptionKeystone:
default: 'overcloud-keystone' default: 'overcloud-keystone'
type: string type: string
@ -463,6 +463,8 @@ resources:
ContainerKeystoneConfigImage: {get_param: ContainerKeystoneConfigImage} ContainerKeystoneConfigImage: {get_param: ContainerKeystoneConfigImage}
conditions: conditions:
keystone_workers_set:
not: {equals : [{get_param: KeystoneWorkers}, 0]}
public_tls_enabled: public_tls_enabled:
and: and:
- {get_param: EnablePublicTLS} - {get_param: EnablePublicTLS}
@ -593,7 +595,10 @@ outputs:
"%{lookup('fqdn_$NETWORK')}" "%{lookup('fqdn_$NETWORK')}"
params: params:
$NETWORK: {get_param: [ServiceNetMap, KeystonePublicApiNetwork]} $NETWORK: {get_param: [ServiceNetMap, KeystonePublicApiNetwork]}
keystone::wsgi::apache::workers: {get_param: KeystoneWorkers} keystone::wsgi::apache::workers:
if:
- keystone_workers_set
- {get_param: KeystoneWorkers}
# override via extraconfig: # override via extraconfig:
keystone::wsgi::apache::threads: 1 keystone::wsgi::apache::threads: 1
keystone::db::database_db_max_retries: -1 keystone::db::database_db_max_retries: -1

View File

@ -41,9 +41,9 @@ parameters:
type: boolean type: boolean
default: false default: false
ManilaWorkers: ManilaWorkers:
type: string type: number
description: Set the number of workers for manila::wsgi::apache description: Set the number of workers for manila::wsgi::apache
default: '%{::os_workers}' default: 0
ManilaPassword: ManilaPassword:
description: The password for the manila service account. description: The password for the manila service account.
type: string type: string
@ -118,6 +118,10 @@ parameters:
Use the advanced (eventlet safe) memcached client pool. Use the advanced (eventlet safe) memcached client pool.
default: true default: true
conditions:
manila_workers_set:
not: {equals : [{get_param: ManilaWorkers}, 0]}
resources: resources:
ContainersCommon: ContainersCommon:
type: ../containers-common.yaml type: ../containers-common.yaml
@ -257,7 +261,10 @@ outputs:
"%{lookup('fqdn_$NETWORK')}" "%{lookup('fqdn_$NETWORK')}"
params: params:
$NETWORK: {get_param: [ServiceNetMap, ManilaApiNetwork]} $NETWORK: {get_param: [ServiceNetMap, ManilaApiNetwork]}
manila::wsgi::apache::workers: {get_param: ManilaWorkers} manila::wsgi::apache::workers:
if:
- manila_workers_set
- {get_param: ManilaWorkers}
service_config_settings: service_config_settings:
map_merge: map_merge:
- {get_attr: [ManilaBase, role_data, service_config_settings]} - {get_attr: [ManilaBase, role_data, service_config_settings]}

View File

@ -60,25 +60,21 @@ parameters:
description: hash of optional environment variables description: hash of optional environment variables
type: json type: json
NeutronWorkers: NeutronWorkers:
default: '' default: 0
description: | description: |
Sets the number of API workers for the Neutron service. Sets the number of API workers for the Neutron service.
The default value results in the configuration being left unset The default value results in the configuration being left unset
and a system-dependent default will be chosen (usually the number and a system-dependent default will be chosen.
of processors). Please note that this can result in a large number type: number
of processes and memory consumption on systems with a large core
count. On such systems it is recommended that a non-default value
be selected that matches the load requirements.
type: string
NeutronRpcWorkers: NeutronRpcWorkers:
default: '' default: 0
description: | description: |
Sets the number of RPC workers for the Neutron service. Sets the number of RPC workers for the Neutron service.
If not specified, it'll take the value of NeutronWorkers and if this is If not specified, it'll take the value of NeutronWorkers and if this is
not specified either, the default value results in the configuration not specified either, the default value results in the configuration
being left unset and a system-dependent default will be chosen being left unset and a system-dependent default will be chosen
(usually 1). (usually 1).
type: string type: number
NeutronPassword: NeutronPassword:
description: The password for the neutron service and db account, used by neutron agents. description: The password for the neutron service and db account, used by neutron agents.
type: string type: string
@ -233,9 +229,9 @@ parameter_groups:
conditions: conditions:
neutron_workers_set: neutron_workers_set:
not: {equals : [{get_param: NeutronWorkers}, '']} not: {equals : [{get_param: NeutronWorkers}, 0]}
neutron_rpc_workers_set: neutron_rpc_workers_set:
not: {equals : [{get_param: NeutronRpcWorkers}, '']} not: {equals : [{get_param: NeutronRpcWorkers}, 0]}
neutron_ovs_int_br_set: neutron_ovs_int_br_set:
not: {equals : [{get_param: NeutronOvsIntegrationBridge}, '']} not: {equals : [{get_param: NeutronOvsIntegrationBridge}, '']}
az_set: az_set:

View File

@ -47,16 +47,12 @@ parameters:
type: string type: string
hidden: true hidden: true
NeutronWorkers: NeutronWorkers:
default: '' default: 0
description: | description: |
Sets the number of worker processes for the neutron metadata agent. The Sets the number of worker processes for the neutron metadata agent. The
default value results in the configuration being left unset and a default value results in the configuration being left unset and a
system-dependent default will be chosen (usually the number of system-dependent default will be chosen.
processors). Please note that this can result in a large number of type: number
processes and memory consumption on systems with a large core count. On
such systems it is recommended that a non-default value be selected that
matches the load requirements.
type: string
MonitoringSubscriptionNeutronMetadata: MonitoringSubscriptionNeutronMetadata:
default: 'overcloud-neutron-metadata' default: 'overcloud-neutron-metadata'
type: string type: string
@ -74,7 +70,7 @@ parameters:
conditions: conditions:
neutron_workers_set: neutron_workers_set:
not: {equals : [{get_param: NeutronWorkers}, '']} not: {equals : [{get_param: NeutronWorkers}, 0]}
neutron_shared_metadata_set: neutron_shared_metadata_set:
not: {equals: [{get_param: NeutronMetadataProxySharedSecret}, '']} not: {equals: [{get_param: NeutronMetadataProxySharedSecret}, '']}

View File

@ -71,16 +71,12 @@ parameters:
type: string type: string
hidden: true hidden: true
NeutronMetadataWorkers: NeutronMetadataWorkers:
default: '' default: 0
description: | description: |
Sets the number of worker processes for the neutron OVN metadata agent. Sets the number of worker processes for the neutron OVN metadata agent.
The default value results in the configuration being left unset and a The default value results in the configuration being left unset and a
system-dependent default will be chosen (usually the number of system-dependent default will be chosen.
processors). Please note that this can result in a large number of type: number
processes and memory consumption on systems with a large core count. On
such systems it is recommended that a non-default value be selected that
matches the load requirements.
type: string
OVNSouthboundServerPort: OVNSouthboundServerPort:
description: Port of the OVN Southbound DB server description: Port of the OVN Southbound DB server
type: number type: number
@ -121,7 +117,7 @@ parameters:
conditions: conditions:
neutron_metadata_workers_set: neutron_metadata_workers_set:
not: {equals : [{get_param: NeutronMetadataWorkers}, '']} not: {equals : [{get_param: NeutronMetadataWorkers}, 0]}
key_size_override_set: key_size_override_set:
not: {equals: [{get_param: OvnMetadataCertificateKeySize}, '']} not: {equals: [{get_param: OvnMetadataCertificateKeySize}, '']}

View File

@ -62,7 +62,7 @@ parameters:
SwiftWorkers: SwiftWorkers:
default: 0 default: 0
description: Number of workers for Swift service. description: Number of workers for Swift service.
type: string type: number
KeystoneRegion: KeystoneRegion:
type: string type: string
default: 'regionOne' default: 'regionOne'
@ -110,7 +110,7 @@ conditions:
cors_allowed_origin_set: cors_allowed_origin_set:
not: {equals : [{get_param: SwiftCorsAllowedOrigin}, '']} not: {equals : [{get_param: SwiftCorsAllowedOrigin}, '']}
swift_workers_set: swift_workers_set:
not: {equals : [{get_param: SwiftWorkers}, '0']} not: {equals : [{get_param: SwiftWorkers}, 0]}
resources: resources:
ContainersCommon: ContainersCommon:

View File

@ -79,15 +79,15 @@ parameters:
SwiftAccountWorkers: SwiftAccountWorkers:
default: 0 default: 0
description: Number of workers for Swift account service. description: Number of workers for Swift account service.
type: string type: number
SwiftContainerWorkers: SwiftContainerWorkers:
default: 0 default: 0
description: Number of workers for Swift account service. description: Number of workers for Swift account service.
type: string type: number
SwiftObjectWorkers: SwiftObjectWorkers:
default: 0 default: 0
description: Number of workers for Swift account service. description: Number of workers for Swift account service.
type: string type: number
SwiftReconCronMinute: SwiftReconCronMinute:
type: string type: string
description: > description: >
@ -138,11 +138,11 @@ conditions:
- get_param: SwiftRawDisks - get_param: SwiftRawDisks
- {} - {}
account_workers_set: account_workers_set:
not: {equals : [{get_param: SwiftAccountWorkers}, '0']} not: {equals : [{get_param: SwiftAccountWorkers}, 0]}
container_workers_set: container_workers_set:
not: {equals : [{get_param: SwiftContainerWorkers}, '0']} not: {equals : [{get_param: SwiftContainerWorkers}, 0]}
object_workers_set: object_workers_set:
not: {equals : [{get_param: SwiftObjectWorkers}, '0']} not: {equals : [{get_param: SwiftObjectWorkers}, 0]}
use_node_data_lookup: {equals : [{get_param: SwiftUseNodeDataLookup}, true]} use_node_data_lookup: {equals : [{get_param: SwiftUseNodeDataLookup}, true]}
resources: resources: