diff --git a/manifests/orchestrator.pp b/manifests/orchestrator.pp index 6a757a7..fd02d39 100644 --- a/manifests/orchestrator.pp +++ b/manifests/orchestrator.pp @@ -10,21 +10,21 @@ # # [*max_workers*] # (Optional) Maximum number of workers to execute the rating process. -# Defaults to $facts['os_service_default'] +# Defaults to $facts['os_workers'] # # [*max_workers_reprocessing*] # (Optional) Maximum number of workers to execute the reprocessing. -# Defaults to $facts['os_service_default'] +# Defaults to $facts['os_workers'] # # [*max_threads*] -# (Optional) Maximal number of threads to use per worker. -# Defaults to $facts['os_service_default'] +# (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_service_default'], - $max_workers_reprocessing = $facts['os_service_default'], - $max_threads = $facts['os_service_default'] + $max_workers = $facts['os_workers'], + $max_workers_reprocessing = $facts['os_workers'], + $max_threads = 16, ) { include cloudkitty::deps diff --git a/releasenotes/notes/cap-orchestrator-max-workers-and-threads-36898c680850f418.yaml b/releasenotes/notes/cap-orchestrator-max-workers-and-threads-36898c680850f418.yaml new file mode 100644 index 0000000..9235d90 --- /dev/null +++ b/releasenotes/notes/cap-orchestrator-max-workers-and-threads-36898c680850f418.yaml @@ -0,0 +1,11 @@ +--- +upgrade: + - | + Default values of the following parameters have been changed to avoid + using too many processes or threads in node with many cores. + + - ``cloudkitty::orchestrator::max_workers`` now defaults to + the ``os_workers`` fact. + - ``cloudkitty::orchestrator::max_workers_reprocessing`` now defaults to + the ``os_workers`` fact. + - ``cloudkitty::orchestrator::max_threads`` now defaults to `16`. diff --git a/spec/classes/cloudkitty_orchestrator_spec.rb b/spec/classes/cloudkitty_orchestrator_spec.rb index 4f23d19..4cf7503 100644 --- a/spec/classes/cloudkitty_orchestrator_spec.rb +++ b/spec/classes/cloudkitty_orchestrator_spec.rb @@ -14,9 +14,9 @@ describe 'cloudkitty::orchestrator' do :backend_url => '', :manage_config => false, ) - is_expected.to contain_cloudkitty_config('orchestrator/max_workers').with_value('') - is_expected.to contain_cloudkitty_config('orchestrator/max_workers_reprocessing').with_value('') - is_expected.to contain_cloudkitty_config('orchestrator/max_threads').with_value('') + is_expected.to contain_cloudkitty_config('orchestrator/max_workers').with_value(4) + is_expected.to contain_cloudkitty_config('orchestrator/max_workers_reprocessing').with_value(4) + is_expected.to contain_cloudkitty_config('orchestrator/max_threads').with_value(16) end end @@ -49,7 +49,9 @@ describe 'cloudkitty::orchestrator' do }).each do |os,facts| context "on #{os}" do let (:facts) do - facts.merge!(OSDefaults.get_facts()) + facts.merge!(OSDefaults.get_facts( + :os_workers => 4, + )) end it_configures 'cloudkitty::orchestrator'