Support configurable metadata_workers

Adds config option worker-multiplier to allow
configuring the number of workers used for the
metadata api when using local dhcp.

Change-Id: Ie3a7d6aab0d9902a6637637fbf75b2df3ec084b1
Closes-Bug: 1707618
This commit is contained in:
Edward Hope-Morley 2017-08-11 18:20:13 +01:00
parent 68ec5b7ecf
commit fbed3f3d7a
4 changed files with 14 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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