rabbitmq: change io_thread_pool based on platform cpus

By default, rabbitmq calculates the io thread pool size based on cpus.
On AIO, not all cpus are reserved for platform services. The pool size
should be calculated based on platform cpus.

Change-Id: I856e8dda6827a4c36944f43eccdc9a91b19655eb
Depends-On: https://review.opendev.org/#/c/677591/
Closes-Bug: 1834796
Signed-off-by: Bin Yang <bin.yang@intel.com>
(cherry picked from commit b1b7878bcb)
This commit is contained in:
Bin Yang 2019-08-13 09:17:45 +08:00
parent c0ce04ba16
commit 7e6e52464e
1 changed files with 11 additions and 0 deletions

View File

@ -20,6 +20,13 @@ class RabbitmqHelm(openstack.OpenstackBaseHelm):
def get_overrides(self, namespace=None):
limit_enabled, limit_cpus, limit_mem_mib = self._get_platform_res_limit()
# Refer to: https://github.com/rabbitmq/rabbitmq-common/commit/4f9ef33cf9ba52197ff210ffcdf6629c1b7a6e9e
io_thread_pool_size = limit_cpus * 16
if io_thread_pool_size < 64:
io_thread_pool_size = 64
elif io_thread_pool_size > 1024:
io_thread_pool_size = 1024
overrides = {
common.HELM_NS_OPENSTACK: {
'pod': {
@ -42,6 +49,10 @@ class RabbitmqHelm(openstack.OpenstackBaseHelm):
}
}
},
'io_thread_pool': {
'enabled': limit_enabled,
'size': "%d" % (io_thread_pool_size)
},
'endpoints': self._get_endpoints_overrides(),
}
}