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: I458791aa8027cffeeec49698b302cb96ae5af2e2
This commit is contained in:
Maksym Yatsenko 2016-10-10 19:34:03 +03:00
parent 2d76effaba
commit a5f39c6233
3 changed files with 10 additions and 5 deletions

View File

@ -85,7 +85,7 @@
#
# [*threads*]
# (optional) The number of threads for the vhost.
# Defaults to $::processorcount
# Defaults to $::os_workers
#
# [*user*]
# (optional) User with permissions on the script
@ -145,7 +145,7 @@ define openstacklib::wsgi::apache (
$ssl_crl = undef,
$ssl_crl_path = undef,
$ssl_key = undef,
$threads = $::processorcount,
$threads = $::os_workers,
$user = undef,
$workers = 1,
$wsgi_daemon_process = $name,

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

@ -23,7 +23,7 @@ describe 'openstacklib::wsgi::apache' do
let :global_facts do
{
:processorcount => 42,
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld'
}
@ -79,7 +79,7 @@ describe 'openstacklib::wsgi::apache' do
'user' => 'keystone',
'group' => 'keystone',
'processes' => 1,
'threads' => global_facts[:processorcount],
'threads' => global_facts[:os_workers],
},
'wsgi_application_group' => '%{GLOBAL}',
'require' => 'File[keystone_wsgi]',
@ -116,7 +116,7 @@ describe 'openstacklib::wsgi::apache' do
'user' => 'keystone',
'group' => 'keystone',
'processes' => '37',
'threads' => '42',
'threads' => '8',
},
'wsgi_process_group' => 'keystone_wsgi',
'wsgi_script_aliases' => { '/' => "/var/www/cgi-bin/keystone/main" },