diff --git a/config.yaml b/config.yaml index 9f782ea4..5afc2490 100644 --- a/config.yaml +++ b/config.yaml @@ -207,6 +207,15 @@ options: . Multiple devices can be configured by providing multi values delimited by spaces. + worker-multiplier: + type: float + default: + description: | + The CPU core multiplier to use when configuring worker processes for + this services e.g. metadata-agent. By default, the number of workers for + each daemon is set to twice the number of CPU cores a service unit has. + When deployed in a LXD container, this default value will be capped to 4 + workers unless this configuration option is set. # Network config (by default all access is over 'private-address') os-data-network: type: string diff --git a/hooks/neutron_ovs_utils.py b/hooks/neutron_ovs_utils.py index 90aca73a..0fece95b 100644 --- a/hooks/neutron_ovs_utils.py +++ b/hooks/neutron_ovs_utils.py @@ -62,6 +62,7 @@ from charmhelpers.contrib.openstack.neutron import ( from charmhelpers.contrib.openstack.context import ( ExternalPortContext, DataPortContext, + WorkerConfigContext, ) from charmhelpers.core.host import ( adduser, @@ -184,7 +185,8 @@ METADATA_RESOURCE_MAP = OrderedDict([ (NEUTRON_METADATA_AGENT_CONF, { 'services': ['neutron-metadata-agent'], 'contexts': [neutron_ovs_context.SharedSecretContext(), - neutron_ovs_context.APIIdentityServiceContext()], + neutron_ovs_context.APIIdentityServiceContext(), + WorkerConfigContext()], }), ]) DHCP_RESOURCE_MAP = OrderedDict([ diff --git a/templates/icehouse/metadata_agent.ini b/templates/icehouse/metadata_agent.ini index bddc97f4..9e923267 100644 --- a/templates/icehouse/metadata_agent.ini +++ b/templates/icehouse/metadata_agent.ini @@ -17,3 +17,4 @@ state_path = /var/lib/neutron nova_metadata_port = 8775 metadata_proxy_shared_secret = {{ shared_secret }} cache_url = memory://?default_ttl=5 +metadata_workers = {{ workers }} diff --git a/templates/juno/metadata_agent.ini b/templates/juno/metadata_agent.ini index bddc97f4..9e923267 100644 --- a/templates/juno/metadata_agent.ini +++ b/templates/juno/metadata_agent.ini @@ -17,3 +17,4 @@ state_path = /var/lib/neutron nova_metadata_port = 8775 metadata_proxy_shared_secret = {{ shared_secret }} cache_url = memory://?default_ttl=5 +metadata_workers = {{ workers }}