Align worker configuration option

Align ceilometer charm with worker-multiplier usage as found
across the majority of OpenStack Charms.  Worker configuration
values are set for API, Notification and Collector services
as needed for each release. Note that for Ocata or later, API
services are executed as WSGI apps under Apache which was
already plugged into the standard worker calculation logic
in charm helpers.

This includes dropping of the existing api-worker configuration
option in preference to a calculated approach.

Change-Id: Idba7c3012d9d24b7ae6ef8eade4a5261ef1cbddc
Closes-Bug: #1745189
This commit is contained in:
James Page 2018-01-25 09:35:08 +00:00
parent 5d029b7e00
commit b7a329d456
8 changed files with 24 additions and 13 deletions

View File

@ -71,11 +71,15 @@ options:
type: string
default: openstack
description: RabbitMQ virtual host to request access on rabbitmq-server.
api-workers:
type: int
default: 1
worker-multiplier:
type: float
default:
description: |
Number of workers for Ceilometer API server. (>= Kilo).
The CPU core multiplier to use when configuring worker processes for
this service. 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.
# Monitoring config
nagios_context:
type: string

View File

@ -103,7 +103,6 @@ class CeilometerContext(OSContextGenerator):
ctxt = {
'port': CEILOMETER_PORT,
'metering_secret': get_shared_secret(),
'api_workers': config('api-workers'),
'metering_time_to_live': int(config('metering-time-to-live')),
'event_time_to_live': int(config('event-time-to-live')),
}

View File

@ -11,6 +11,9 @@ use_syslog = {{ use_syslog }}
{% include "parts/rabbitmq" -%}
collector_workers = {{ workers }}
notification_workers = {{ workers }}
[api]
port = {{ port }}

View File

@ -8,7 +8,9 @@
debug = {{ debug }}
verbose = {{ verbose }}
use_syslog = {{ use_syslog }}
api_workers = {{ api_workers }}
api_workers = {{ workers }}
collector_workers = {{ workers }}
notification_workers = {{ workers }}
{% include "parts/rabbitmq" -%}

View File

@ -8,6 +8,10 @@
debug = {{ debug }}
verbose = {{ verbose }}
use_syslog = {{ use_syslog }}
api_workers = {{ workers }}
collector_workers = {{ workers }}
notification_workers = {{ workers }}
event_pipeline_cfg_file = /etc/ceilometer/event_pipeline_alarm.yaml
{% if gnocchi_url -%}
@ -20,7 +24,6 @@ event_dispatchers = database
[api]
port = {{ port }}
workers = {{ api_workers }}
{% if service_host -%}
[service_credentials]

View File

@ -21,13 +21,12 @@ meter_dispatchers = database
transport_url = {{ transport_url }}
{%- endif %}
[api]
port = {{ port }}
workers = {{ api_workers }}
[notification]
workers = {{ workers }}
[collector]
workers = {{ workers }}
{% if service_host -%}
[service_credentials]
auth_url = {{ service_protocol }}://{{ service_host }}:{{ service_port }}

View File

@ -503,6 +503,9 @@ class CeilometerBasicDeployment(OpenStackAmuletDeployment):
'password':
ks_rel['service_password']}
if self._get_openstack_release() >= self.xenial_ocata:
del expected['api']
for section, pairs in expected.iteritems():
ret = u.validate_config_data(unit, conf, section, pairs)
if ret:

View File

@ -129,7 +129,6 @@ class CeilometerContextsTest(CharmTestCase):
self.assertEqual(contexts.CeilometerContext()(), {
'port': 8777,
'metering_secret': 'mysecret',
'api_workers': 1,
'metering_time_to_live': -1,
'event_time_to_live': -1,
})
@ -143,7 +142,6 @@ class CeilometerContextsTest(CharmTestCase):
self.assertEqual(context, {
'port': 8777,
'metering_secret': 'mysecret',
'api_workers': 1,
'metering_time_to_live': 7776000,
'event_time_to_live': 7776000,
})