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: I09076c05ffd42219e8662d3393b1732400d297dc
This commit is contained in:
Maksym Yatsenko 2016-10-06 14:19:21 +03:00
parent 53f09f48f0
commit ed61f3f507
7 changed files with 14 additions and 11 deletions

View File

@ -404,13 +404,13 @@
# (optional) The number of worker processes to serve the admin eventlet application.
# This option is deprecated along with eventlet and will be removed in M.
# This setting has no affect when using WSGI.
# Defaults to max($::processorcount, 2)
# Defaults to $::os_workers
#
# [*public_workers*]
# (optional) The number of worker processes to serve the public eventlet application.
# This option is deprecated along with eventlet and will be removed in M.
# This setting has no affect when using WSGI.
# Defaults to max($::processorcount, 2)
# Defaults to $::os_workers
#
# [*sync_db*]
# (Optional) Run db sync on the node.
@ -749,8 +749,8 @@ class keystone(
$enable_proxy_headers_parsing = $::os_service_default,
$purge_config = false,
# DEPRECATED PARAMETERS
$admin_workers = max($::processorcount, 2),
$public_workers = max($::processorcount, 2),
$admin_workers = $::os_workers,
$public_workers = $::os_workers,
$service_provider = undef,
$verbose = undef,
$enable_pki_setup = undef,

View File

@ -95,7 +95,7 @@
#
# [*threads*]
# (optional) The number of threads for the vhost.
# Defaults to $::processorcount
# Defaults to $::os_workers
#
# [*wsgi_application_group*]
# (optional) The application group of the WSGI script.
@ -188,7 +188,7 @@ class keystone::wsgi::apache (
$ssl_crl_path = undef,
$ssl_crl = undef,
$ssl_certs_dir = undef,
$threads = $::processorcount,
$threads = $::os_workers,
$priority = '10',
$wsgi_application_group = '%{GLOBAL}',
$wsgi_pass_authorization = 'On',

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

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

@ -11,7 +11,7 @@ describe 'keystone::roles::admin' do
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '7.0',
:processorcount => '1'
:os_workers => 1,
})
end

View File

@ -4,7 +4,6 @@ describe 'keystone' do
let :global_facts do
{
:processorcount => 42,
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld'
}
@ -15,7 +14,6 @@ describe 'keystone' do
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '7.0',
:processorcount => '1'
}))
end

View File

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