
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>
62 lines
2.1 KiB
Ruby
62 lines
2.1 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'cloudkitty::orchestrator' do
|
|
|
|
shared_examples_for 'cloudkitty::orchestrator' do
|
|
|
|
context 'with defaults' do
|
|
it { is_expected.to contain_class('cloudkitty::deps') }
|
|
|
|
it 'configures orchestrator' do
|
|
is_expected.to contain_cloudkitty_config('orchestrator/coordination_url')\
|
|
.with_value('<SERVICE DEFAULT>').with_secret(true)
|
|
is_expected.to contain_oslo__coordination('cloudkitty_config').with(
|
|
:backend_url => '<SERVICE DEFAULT>',
|
|
:manage_config => false,
|
|
)
|
|
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
|
|
|
|
context 'with parameters set' do
|
|
let :params do
|
|
{
|
|
:coordination_url => 'etcd3+http://127.0.0.1:2379',
|
|
:max_workers => 4,
|
|
:max_workers_reprocessing => 5,
|
|
:max_threads => 20,
|
|
}
|
|
end
|
|
|
|
it 'configures orchestrator' do
|
|
is_expected.to contain_cloudkitty_config('orchestrator/coordination_url')\
|
|
.with_value('etcd3+http://127.0.0.1:2379').with_secret(true)
|
|
is_expected.to contain_oslo__coordination('cloudkitty_config').with(
|
|
:backend_url => 'etcd3+http://127.0.0.1:2379',
|
|
:manage_config => false,
|
|
)
|
|
is_expected.to contain_cloudkitty_config('orchestrator/max_workers').with_value(4)
|
|
is_expected.to contain_cloudkitty_config('orchestrator/max_workers_reprocessing').with_value(5)
|
|
is_expected.to contain_cloudkitty_config('orchestrator/max_threads').with_value(20)
|
|
end
|
|
end
|
|
end
|
|
|
|
on_supported_os({
|
|
:supported_os => OSDefaults.get_supported_os
|
|
}).each do |os,facts|
|
|
context "on #{os}" do
|
|
let (:facts) do
|
|
facts.merge!(OSDefaults.get_facts(
|
|
:os_workers => 4,
|
|
))
|
|
end
|
|
|
|
it_configures 'cloudkitty::orchestrator'
|
|
end
|
|
end
|
|
|
|
end
|