Skip to content

Commit a5f39c6

Browse files
author
Maksym Yatsenko
committed
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
1 parent 2d76eff commit a5f39c6

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

manifests/wsgi/apache.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
#
8686
# [*threads*]
8787
# (optional) The number of threads for the vhost.
88-
# Defaults to $::processorcount
88+
# Defaults to $::os_workers
8989
#
9090
# [*user*]
9191
# (optional) User with permissions on the script
@@ -145,7 +145,7 @@
145145
$ssl_crl = undef,
146146
$ssl_crl_path = undef,
147147
$ssl_key = undef,
148-
$threads = $::processorcount,
148+
$threads = $::os_workers,
149149
$user = undef,
150150
$workers = 1,
151151
$wsgi_daemon_process = $name,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
other:
3+
- Parameters that control the number of spawned child processes for
4+
distributing processing have had their default value changed from
5+
::processorcount to ::os_workers.

spec/defines/openstacklib_wsgi_apache_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
let :global_facts do
2525
{
26-
:processorcount => 42,
26+
:os_workers => 8,
2727
:concat_basedir => '/var/lib/puppet/concat',
2828
:fqdn => 'some.host.tld'
2929
}
@@ -79,7 +79,7 @@
7979
'user' => 'keystone',
8080
'group' => 'keystone',
8181
'processes' => 1,
82-
'threads' => global_facts[:processorcount],
82+
'threads' => global_facts[:os_workers],
8383
},
8484
'wsgi_application_group' => '%{GLOBAL}',
8585
'require' => 'File[keystone_wsgi]',
@@ -116,7 +116,7 @@
116116
'user' => 'keystone',
117117
'group' => 'keystone',
118118
'processes' => '37',
119-
'threads' => '42',
119+
'threads' => '8',
120120
},
121121
'wsgi_process_group' => 'keystone_wsgi',
122122
'wsgi_script_aliases' => { '/' => "/var/www/cgi-bin/keystone/main" },

0 commit comments

Comments
 (0)