Merge "Fix default RPC worker count"

This commit is contained in:
Zuul 2019-08-02 13:17:45 +00:00 committed by Gerrit Code Review
commit cee6360a28
2 changed files with 6 additions and 2 deletions

View File

@ -176,7 +176,7 @@ def _get_rpc_workers(plugin=None):
workers = cfg.CONF.rpc_workers
if workers is None:
# By default, half as many rpc workers as api workers
workers = int(_get_worker_count() / 2)
workers = int(_get_api_workers() / 2)
if workers < 1:
workers = 1

View File

@ -61,9 +61,13 @@ class TestRunRpcWorkers(base.BaseTestCase):
def test_rpc_workers_zero(self):
self._test_rpc_workers(0, 1)
def test_rpc_workers_default(self):
def test_rpc_workers_default_api_workers_default(self):
self._test_rpc_workers(None, int(self.worker_count / 2))
def test_rpc_workers_default_api_workers_set(self):
cfg.CONF.set_override('api_workers', 18)
self._test_rpc_workers(None, 9)
def test_rpc_workers_defined(self):
self._test_rpc_workers(42, 42)