Correct workers configuration in All-in-one System Controller

Since All-in-one duplex can also be used as the System Controller
in distributed cloud, the number of eng_workers is therefore derived
the same way as in standard system.

Story: 2007267
Task: 38785
Change-Id: I739eee867588ae510b875d0d3be4f45b57ab2e38
Signed-off-by: Tee Ngo <tee.ngo@windriver.com>
This commit is contained in:
Tee Ngo
2020-02-18 14:47:53 -05:00
parent 1b620e83c6
commit 9d78fdc2ce

View File

@@ -53,12 +53,18 @@ class platform::params (
# memory headroom per worker (e.g., buffers, cached)
$eng_overhead_mb = 1000
notice("DEBUG: Platform cpu count obtained from sysinv DB is ${platform_cpu_count}.")
# number of workers per service
if $system_type == 'All-in-one' {
if ($system_type != 'All-in-one' or $distributed_cloud_role == 'systemcontroller') {
# number of workers we can support based on memory
$small_footprint = false
$eng_workers_mem = floor($::memorysize_mb) / ($eng_worker_mb + $eng_overhead_mb)
$eng_workers = min($eng_max_workers, $eng_workers_mem, max($phys_core_count, 2))
$eng_workers_by_2 = min($eng_max_workers, $eng_workers_mem, max($phys_core_count/2, 2))
$eng_workers_by_4 = min($eng_max_workers, $eng_workers_mem, max($phys_core_count/4, 2))
$eng_workers_by_5 = min($eng_max_workers, $eng_workers_mem, max($phys_core_count/5, 2))
$eng_workers_by_6 = min($eng_max_workers, $eng_workers_mem, max($phys_core_count/6, 2))
} else {
$small_footprint = true
# Set eng_workers for AIO based on the number of platform cores, not exceeding 2 for
# AIO simplex, Xeon-D and virtual box and not exceeding 3 for AIO duplex.
# All eng_workers derivatives are set to 1 for AIO.
@@ -76,15 +82,6 @@ class platform::params (
$eng_workers_by_4 = $eng_min_workers
$eng_workers_by_5 = $eng_min_workers
$eng_workers_by_6 = $eng_min_workers
} else {
# number of workers we can support based on memory
$small_footprint = false
$eng_workers_mem = floor($::memorysize_mb) / ($eng_worker_mb + $eng_overhead_mb)
$eng_workers = min($eng_max_workers, $eng_workers_mem, max($phys_core_count, 2))
$eng_workers_by_2 = min($eng_max_workers, $eng_workers_mem, max($phys_core_count/2, 2))
$eng_workers_by_4 = min($eng_max_workers, $eng_workers_mem, max($phys_core_count/4, 2))
$eng_workers_by_5 = min($eng_max_workers, $eng_workers_mem, max($phys_core_count/5, 2))
$eng_workers_by_6 = min($eng_max_workers, $eng_workers_mem, max($phys_core_count/6, 2))
}
$init_database = $controller_upgrade