Change worker defaults to ::os_workers

This patch changes the default worker count from ::processorcount to the
new ::os_workers fact. ::os_workers is based on the number of processors
(currently cpu/4) but is capped at a maximum of 8 worker processors.
This is a much more reasonable default in general and prevents excessive
resource consumption on systems with a large number of CPUs.

Change-Id: Idfd8e3f4fe91df7d70e8c35a491c076b0b8f2348
This commit is contained in:
Maksym Yatsenko 2016-10-08 02:06:17 +03:00
parent 36263dc353
commit 86221d0df0
8 changed files with 26 additions and 21 deletions

View File

@ -69,7 +69,7 @@
#
# [*workers*]
# (optional) Number of trove API worker processes to start
# Default: $::processorcount
# Default: $::os_workers
#
# [*enabled*]
# (optional) Whether to enable services.
@ -156,7 +156,7 @@ class trove::api(
$bind_host = '0.0.0.0',
$bind_port = '8779',
$backlog = '4096',
$workers = $::processorcount,
$workers = $::os_workers,
$enabled = true,
$purge_config = false,
$cert_file = false,

View File

@ -48,7 +48,7 @@
#
# [*workers*]
# (optional) Number of trove conductor worker processes to start
# Default: $::processorcount
# Default: $::os_workers
#
# [*enable_profiler*]
# (optional) If False fully disable profiling feature.
@ -75,7 +75,7 @@ class trove::conductor(
$log_facility = $::os_service_default,
$auth_url = 'http://localhost:5000/v2.0',
$conductor_manager = 'trove.conductor.manager.Manager',
$workers = $::processorcount,
$workers = $::os_workers,
$enable_profiler = $::os_service_default,
$trace_sqlalchemy = $::os_service_default,
# Deprecated

View File

@ -0,0 +1,5 @@
---
other:
- Parameters that control the number of spawned child processes for
distributing processing have had their default value changed from
::processorcount to ::os_workers.

View File

@ -276,8 +276,8 @@ describe 'trove::api' do
context 'on Debian platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'Debian',
:processorcount => 8,
:osfamily => 'Debian',
:os_workers => 8,
})
end
@ -292,8 +292,8 @@ describe 'trove::api' do
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'RedHat',
:processorcount => 8,
:osfamily => 'RedHat',
:os_workers => 8,
})
end

View File

@ -197,8 +197,8 @@ describe 'trove::conductor' do
context 'on Debian platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'Debian',
:processorcount => 8,
:osfamily => 'Debian',
:os_workers => 8,
})
end
@ -213,8 +213,8 @@ describe 'trove::conductor' do
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'RedHat',
:processorcount => 8,
:osfamily => 'RedHat',
:os_workers => 8,
})
end

View File

@ -30,7 +30,7 @@ describe 'trove::db::postgresql' do
context "on #{os}" do
let (:facts) do
facts.merge(OSDefaults.get_facts({
:processorcount => 8,
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end

View File

@ -217,8 +217,8 @@ describe 'trove::guestagent' do
context 'on Debian platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'Debian',
:processorcount => 8
:osfamily => 'Debian',
:os_workers => 8
})
end
@ -233,8 +233,8 @@ describe 'trove::guestagent' do
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'RedHat',
:processorcount => 8
:osfamily => 'RedHat',
:os_workers => 8
})
end

View File

@ -305,8 +305,8 @@ describe 'trove::taskmanager' do
context 'on Debian platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'Debian',
:processorcount => 8
:osfamily => 'Debian',
:os_workers => 8
})
end
@ -321,8 +321,8 @@ describe 'trove::taskmanager' do
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'RedHat',
:processorcount => 8
:osfamily => 'RedHat',
:os_workers => 8
})
end