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: Ib03ad48060349921b94fc4c794b3e02f41ad979d
This commit is contained in:
Maksym Yatsenko 2016-10-07 15:44:18 +03:00
parent 934ff54898
commit d5d026a016
6 changed files with 10 additions and 7 deletions

View File

@ -50,7 +50,7 @@
#
# [*threads*]
# (optional) The number of threads for the vhost.
# Defaults to $::processorcount
# Defaults to $::os_workers
#
# [*ssl_cert*]
# [*ssl_key*]
@ -87,7 +87,7 @@ class ironic::wsgi::apache (
$ssl_crl_path = undef,
$ssl_crl = undef,
$ssl_certs_dir = undef,
$threads = $::processorcount,
$threads = $::os_workers,
$priority = '10',
) {

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

@ -145,7 +145,6 @@ describe 'ironic::api' do
:operatingsystemrelease => '8.0',
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld',
:processorcount => 2,
})
end
@ -165,7 +164,6 @@ describe 'ironic::api' do
:operatingsystemrelease => '7.2',
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld',
:processorcount => 2,
})
end

View File

@ -30,7 +30,7 @@ describe 'ironic::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

@ -37,7 +37,7 @@ describe 'ironic::db::sync' 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

@ -4,7 +4,7 @@ describe 'ironic::wsgi::apache' do
let :global_facts do
OSDefaults.get_facts({
:processorcount => 42,
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld'
})