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: I3edd574f60be594b18da78284831ffd19d2819f7
This commit is contained in:
Juan Antonio Osorio Robles 2017-10-13 08:34:43 +03:00
parent beeae866c1
commit d4711a0057
2 changed files with 7 additions and 7 deletions

View File

@ -42,7 +42,7 @@
#
# [*workers*]
# Number of WSGI workers to spawn.
# Optional. Defaults to 1
# Optional. Defaults to $::os_workers
#
# [*priority*]
# (optional) The priority for the vhost.
@ -50,7 +50,7 @@
#
# [*threads*]
# (optional) The number of threads for the vhost.
# Defaults to $::os_workers
# Defaults to 1
#
# [*wsgi_process_display_name*]
# (optional) Name of the WSGI process display-name.
@ -102,7 +102,7 @@ class cinder::wsgi::apache (
$bind_host = undef,
$path = '/',
$ssl = true,
$workers = 1,
$workers = $::os_workers,
$ssl_cert = undef,
$ssl_key = undef,
$ssl_chain = undef,
@ -111,7 +111,7 @@ class cinder::wsgi::apache (
$ssl_crl = undef,
$ssl_certs_dir = undef,
$wsgi_process_display_name = undef,
$threads = $::os_workers,
$threads = 1,
$priority = '10',
$access_log_file = false,
$access_log_format = false,

View File

@ -14,9 +14,9 @@ describe 'cinder::wsgi::apache' do
:path => '/',
:servername => facts[:fqdn],
:ssl => true,
:threads => facts[:os_workers],
:threads => 1,
:user => 'cinder',
:workers => 1,
:workers => facts[:os_workers],
:wsgi_daemon_process => 'cinder-api',
:wsgi_process_group => 'cinder-api',
:wsgi_script_dir => platform_params[:wsgi_script_path],
@ -56,7 +56,7 @@ describe 'cinder::wsgi::apache' do
:path => '/',
:servername => 'dummy.host',
:ssl => false,
:threads => facts[:os_workers],
:threads => 1,
:user => 'cinder',
:workers => 37,
:wsgi_daemon_process => 'cinder-api',