apache wsgi: Exchange defaults for workers and threads

Due to Python's GIL [1], we can't use multiple threads for running
OpenStack services without a performance penalty, since the execution
ends up serialized, which defeats the purpose.

Instead, we should use several processes, since this approach doesn't
have this limitation.

[1] https://wiki.python.org/moin/GlobalInterpreterLock

Change-Id: I09b4dfa0873c5a086d4492a7e2ebb72460e507c9
This commit is contained in:
Juan Antonio Osorio Robles 2017-09-19 14:53:15 +03:00 committed by Alex Schultz
parent 735c6641f0
commit ca0bf6ea34
2 changed files with 9 additions and 9 deletions

View File

@ -85,7 +85,7 @@
#
# [*threads*]
# (optional) The number of threads for the vhost.
# Defaults to $::os_workers
# Defaults to 1
#
# [*user*]
# (optional) User with permissions on the script
@ -93,7 +93,7 @@
#
# [*workers*]
# (optional) The number of workers for the vhost.
# Defaults to '1'
# Defaults to $::os_workers
#
# [*wsgi_daemon_process*]
# (optional) Name of the WSGI daemon process.
@ -170,9 +170,9 @@ define openstacklib::wsgi::apache (
$ssl_crl = undef,
$ssl_crl_path = undef,
$ssl_key = undef,
$threads = $::os_workers,
$threads = 1,
$user = undef,
$workers = 1,
$workers = $::os_workers,
$wsgi_daemon_process = $name,
$wsgi_process_display_name = $name,
$wsgi_process_group = $name,

View File

@ -78,8 +78,8 @@ describe 'openstacklib::wsgi::apache' do
'wsgi_daemon_process_options' => {
'user' => 'keystone',
'group' => 'keystone',
'processes' => 1,
'threads' => global_facts[:os_workers],
'processes' => global_facts[:os_workers],
'threads' => 1,
'display-name' => 'keystone_wsgi',
},
'wsgi_application_group' => '%{GLOBAL}',
@ -118,7 +118,7 @@ describe 'openstacklib::wsgi::apache' do
'user' => 'keystone',
'group' => 'keystone',
'processes' => '37',
'threads' => '8',
'threads' => '1',
'display-name' => 'keystone_wsgi',
},
'wsgi_process_group' => 'keystone_wsgi',
@ -153,8 +153,8 @@ describe 'openstacklib::wsgi::apache' do
'wsgi_daemon_process_options' => {
'user' => 'someotheruser',
'group' => 'someothergroup',
'processes' => 1,
'threads' => global_facts[:os_workers],
'processes' => global_facts[:os_workers],
'threads' => 1,
'display-name' => 'keystone_wsgi',
'python_path' => '/my/python/admin/path',
},