Files
puppet-cloudkitty/manifests/orchestrator.pp
Takashi Kajinami 87374d71da orchestrator: Cap maximum processes and threads by default
cloudkitty-orchestrator by default launches
 - N workers for rating processing
 - N workers for reprocessing
and also launch 5 * N threads in each worker.

N = Number of cpu cores

This results in huge value in case a node has relatively many cpu
cores (including pseudo cores in case hyper-threading is enabled).

Cap the maximum numbers to avoid too many processes/threads used in
node with many CPU cores.

Change-Id: Id9b2f33777db2d7265ca41e9066135b56aca34d2
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2025-09-08 13:35:22 +00:00

47 lines
1.5 KiB
Puppet

# == Class: cloudkitty::orchestrator
#
# Setup and configure Cloudkitty orchestrator settings.
#
# === Parameters
#
# [*coordination_url*]
# (Optional) Coordination backend URL.
# Defaults to $facts['os_service_default']
#
# [*max_workers*]
# (Optional) Maximum number of workers to execute the rating process.
# Defaults to $facts['os_workers']
#
# [*max_workers_reprocessing*]
# (Optional) Maximum number of workers to execute the reprocessing.
# Defaults to $facts['os_workers']
#
# [*max_threads*]
# (Optional) Maximum number of threads to use per worker.
# Defaults to 16,
#
class cloudkitty::orchestrator (
$coordination_url = $facts['os_service_default'],
$max_workers = $facts['os_workers'],
$max_workers_reprocessing = $facts['os_workers'],
$max_threads = 16,
) {
include cloudkitty::deps
oslo::coordination { 'cloudkitty_config':
backend_url => $coordination_url,
manage_config => false,
}
# all coordination settings should be applied and all packages should be
# installed before service startup
Oslo::Coordination['cloudkitty_config'] -> Anchor['cloudkitty::service::begin']
cloudkitty_config {
'orchestrator/coordination_url': value => $coordination_url, secret => true;
'orchestrator/max_workers': value => $max_workers;
'orchestrator/max_workers_reprocessing': value => $max_workers_reprocessing;
'orchestrator/max_threads': value => $max_threads;
}
}