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: I6b994becf8963020a56902785e2c569553c95a14
This commit is contained in:
Maksym Yatsenko 2016-10-10 16:57:46 +03:00 committed by Alex Schultz
parent d4aa3e5cad
commit 51f5519f11
6 changed files with 10 additions and 7 deletions

View File

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

@ -156,7 +156,7 @@ describe 'ceilometer::api' do
:operatingsystemrelease => '8.0',
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld',
:processorcount => 2 })
})
end
let :platform_params do
@ -175,7 +175,7 @@ describe 'ceilometer::api' do
:operatingsystemmajrelease => '7',
:fqdn => 'some.host.tld',
:concat_basedir => '/var/lib/puppet/concat',
:processorcount => 2 })
})
end
let :platform_params do

View File

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

View File

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

View File

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