Merge "Fix default RPC worker count"
This commit is contained in:
commit
cee6360a28
@ -176,7 +176,7 @@ def _get_rpc_workers(plugin=None):
|
|||||||
workers = cfg.CONF.rpc_workers
|
workers = cfg.CONF.rpc_workers
|
||||||
if workers is None:
|
if workers is None:
|
||||||
# By default, half as many rpc workers as api workers
|
# 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:
|
if workers < 1:
|
||||||
workers = 1
|
workers = 1
|
||||||
|
|
||||||
|
@ -61,9 +61,13 @@ class TestRunRpcWorkers(base.BaseTestCase):
|
|||||||
def test_rpc_workers_zero(self):
|
def test_rpc_workers_zero(self):
|
||||||
self._test_rpc_workers(0, 1)
|
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))
|
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):
|
def test_rpc_workers_defined(self):
|
||||||
self._test_rpc_workers(42, 42)
|
self._test_rpc_workers(42, 42)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user