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: I3aa3757a991d4437d0921cb55c1d08b5c9179de1
This commit is contained in:
Juan Antonio Osorio Robles 2017-10-13 08:36:58 +03:00
parent bc93062962
commit fb86336bf7
2 changed files with 8 additions and 8 deletions

View File

@ -46,7 +46,7 @@
# #
# [*workers*] # [*workers*]
# Number of WSGI workers to spawn. # Number of WSGI workers to spawn.
# Optional. Defaults to 1 # Optional. Defaults to $::os_workers
# #
# [*priority*] # [*priority*]
# (optional) The priority for the vhost. # (optional) The priority for the vhost.
@ -54,11 +54,11 @@
# #
# [*threads*] # [*threads*]
# (optional) The number of threads for the vhost. # (optional) The number of threads for the vhost.
# Defaults to $::os_workers # Defaults to 1
# #
# [*wsgi_process_display_name*] # [*wsgi_process_display_name*]
# (optional) Name of the WSGI process display-name. # (optional) Name of the WSGI process display-name.
# Defaults to undef # Defaults to undef
# #
# [*ssl_cert*] # [*ssl_cert*]
# [*ssl_key*] # [*ssl_key*]
@ -94,7 +94,7 @@ class aodh::wsgi::apache (
$bind_host = undef, $bind_host = undef,
$path = '/', $path = '/',
$ssl = true, $ssl = true,
$workers = 1, $workers = $::os_workers,
$ssl_cert = undef, $ssl_cert = undef,
$ssl_key = undef, $ssl_key = undef,
$ssl_chain = undef, $ssl_chain = undef,
@ -103,7 +103,7 @@ class aodh::wsgi::apache (
$ssl_crl = undef, $ssl_crl = undef,
$ssl_certs_dir = undef, $ssl_certs_dir = undef,
$wsgi_process_display_name = undef, $wsgi_process_display_name = undef,
$threads = $::os_workers, $threads = 1,
$priority = '10', $priority = '10',
$custom_wsgi_process_options = {}, $custom_wsgi_process_options = {},
) { ) {

View File

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