Merge "Set minumum boundary for workers"

This commit is contained in:
Zuul 2024-02-13 01:03:40 +00:00 committed by Gerrit Code Review
commit 267690b505
3 changed files with 19 additions and 4 deletions

View File

@ -24,19 +24,23 @@ SERVICE_OPTS = [
default=40,
help=_('Seconds between running periodic tasks.')),
cfg.IntOpt('api_workers',
min=1,
help=_('Number of separate API worker processes for service. '
'If not specified, the default is equal to the number '
'of CPUs available for best performance, capped by '
'potential RAM usage.')),
cfg.IntOpt('rpc_workers',
min=0,
help=_('Number of RPC worker processes for service. '
'If not specified, the default is equal to half the '
'number of API workers. If set to 0, no RPC worker '
'is launched.')),
cfg.IntOpt('rpc_state_report_workers',
default=1,
min=0,
help=_('Number of RPC worker processes dedicated to the state '
'reports queue.')),
'reports queue. If set to 0, no dedicated RPC worker '
'for state reports queue is launched.')),
cfg.IntOpt('periodic_fuzzy_delay',
default=5,
help=_('Range of seconds to randomly delay when starting the '

View File

@ -92,8 +92,8 @@ class TestRunWsgiApp(base.BaseTestCase):
workers=expected_passed_value)
self.assertEqual(expected_call, start_call)
def test_api_workers_zero(self):
self._test_api_workers(0, 0)
def test_api_workers_one(self):
self._test_api_workers(1, 1)
def test_api_workers_default(self):
self._test_api_workers(None, self.worker_count)
@ -102,7 +102,7 @@ class TestRunWsgiApp(base.BaseTestCase):
self._test_api_workers(42, 42)
def test_start_all_workers(self):
cfg.CONF.set_override('api_workers', 0)
cfg.CONF.set_override('api_workers', 1)
mock.patch.object(service, '_get_rpc_workers').start()
mock.patch.object(service, '_get_plugins_workers').start()
mock.patch.object(service, '_start_workers').start()

View File

@ -0,0 +1,11 @@
---
upgrade:
- |
The ``[DEFAULT] api_workers`` option no longer accepts 0 or negative
values. Previously 0 or a negative value was translated to 1 and
neutron-server launched 1 api worker.
- |
The ``[DEFAULT] rpc_workers`` option and
the ``[DEFAULT] rpc_state_report_workers`` option no longer accept negative
values. To disable these workers, set these options to 0.