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: Id7c5f3df32b4f350d93ed85b6293fe69e64c2cc3
This commit is contained in:
Maksym Yatsenko 2016-10-07 17:17:56 +03:00
parent 8329c052a5
commit d3b12f6937
6 changed files with 9 additions and 6 deletions

View File

@ -54,7 +54,7 @@
#
# [*threads*]
# (optional) The number of threads for the vhost.
# Defaults to $::processorcount
# Defaults to $::os_workers
#
# [*ssl_cert*]
# [*ssl_key*]
@ -90,7 +90,7 @@ class aodh::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

@ -189,7 +189,6 @@ describe 'aodh::api' do
let (:facts) do
facts.merge!(OSDefaults.get_facts({
:fqdn => 'some.host.tld',
:processorcount => 2,
:concat_basedir => '/var/lib/puppet/concat'
}))
end

View File

@ -22,7 +22,7 @@ describe 'aodh::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

@ -90,7 +90,6 @@ describe 'aodh::evaluator' do
let (:facts) do
facts.merge!(OSDefaults.get_facts({
:fqdn => 'some.host.tld',
:processorcount => 2,
:concat_basedir => '/var/lib/puppet/concat'
}))
end

View File

@ -79,7 +79,7 @@ describe 'aodh::wsgi::apache' do
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts({
:processorcount => 42,
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld'
}))