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. See the same kind of change here [2] [1] https://wiki.python.org/moin/GlobalInterpreterLock [2] https://review.openstack.org/#/c/505192/ Change-Id: I9c1ef8991d63b18a0ec106a05576b74ab457a2a0
This commit is contained in:
parent
d666691820
commit
bb54858824
@ -40,11 +40,11 @@
|
||||
#
|
||||
# [*wsgi_processes*]
|
||||
# (optional) Number of Horizon processes to spawn
|
||||
# Defaults to '3'
|
||||
# Defaults to $::os_workers
|
||||
#
|
||||
# [*wsgi_threads*]
|
||||
# (optional) Number of thread to run in a Horizon process
|
||||
# Defaults to '10'
|
||||
# Defaults to '1'
|
||||
#
|
||||
# [*custom_wsgi_process_options*]
|
||||
# (optional) gives you the oportunity to add custom process options or to
|
||||
@ -98,8 +98,8 @@ class horizon::wsgi::apache (
|
||||
$horizon_cert = undef,
|
||||
$horizon_key = undef,
|
||||
$horizon_ca = undef,
|
||||
$wsgi_processes = '3',
|
||||
$wsgi_threads = '10',
|
||||
$wsgi_processes = $::os_workers,
|
||||
$wsgi_threads = '1',
|
||||
$custom_wsgi_process_options = {},
|
||||
$priority = '15',
|
||||
$vhost_conf_name = 'horizon_vhost',
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
The default value for horizon::wsgi::apache::wsgi_processes changed to $::os_workers
|
||||
- |
|
||||
The default value for horizon::wsgi::apache::wsgi_threads changed to 1
|
@ -3,9 +3,7 @@ require 'spec_helper'
|
||||
describe 'horizon::wsgi::apache' do
|
||||
let :params do
|
||||
{
|
||||
:servername => 'some.host.tld',
|
||||
:wsgi_processes => '3',
|
||||
:wsgi_threads => '10',
|
||||
:servername => 'some.host.tld',
|
||||
}
|
||||
end
|
||||
|
||||
@ -46,8 +44,8 @@ describe 'horizon::wsgi::apache' do
|
||||
:wsgi_daemon_process => platforms_params[:wsgi_group],
|
||||
:wsgi_application_group => '%{GLOBAL}',
|
||||
:wsgi_daemon_process_options => {
|
||||
'processes' => params[:wsgi_processes],
|
||||
'threads' => params[:wsgi_threads],
|
||||
'processes' => facts[:os_workers],
|
||||
'threads' => '1',
|
||||
'user' => platforms_params[:unix_user],
|
||||
'group' => platforms_params[:unix_group],
|
||||
'display-name' => 'horizon'
|
||||
@ -58,8 +56,10 @@ describe 'horizon::wsgi::apache' do
|
||||
context 'with overridden parameters' do
|
||||
before do
|
||||
params.merge!({
|
||||
:priority => '10',
|
||||
:redirect_type => 'temp',
|
||||
:priority => '10',
|
||||
:redirect_type => 'temp',
|
||||
:wsgi_processes => '13',
|
||||
:wsgi_threads => '3'
|
||||
})
|
||||
end
|
||||
|
||||
@ -88,8 +88,8 @@ describe 'horizon::wsgi::apache' do
|
||||
:wsgi_daemon_process => platforms_params[:wsgi_group],
|
||||
:wsgi_application_group => '%{GLOBAL}',
|
||||
:wsgi_daemon_process_options => {
|
||||
'processes' => params[:wsgi_processes],
|
||||
'threads' => params[:wsgi_threads],
|
||||
'processes' => '13',
|
||||
'threads' => '3',
|
||||
'user' => platforms_params[:unix_user],
|
||||
'group' => platforms_params[:unix_group],
|
||||
'display-name' => 'horizon'
|
||||
@ -109,8 +109,8 @@ describe 'horizon::wsgi::apache' do
|
||||
|
||||
it { should contain_apache__vhost('horizon_vhost').with(
|
||||
:wsgi_daemon_process_options => {
|
||||
'processes' => params[:wsgi_processes],
|
||||
'threads' => params[:wsgi_threads],
|
||||
'processes' => facts[:os_workers],
|
||||
'threads' => '1',
|
||||
'user' => 'myuser',
|
||||
'group' => platforms_params[:unix_group],
|
||||
'display-name' => 'horizon',
|
||||
@ -492,7 +492,8 @@ describe 'horizon::wsgi::apache' do
|
||||
|
||||
facts.merge!(OSDefaults.get_facts({
|
||||
:fqdn => 'some.host.tld',
|
||||
:concat_basedir => '/var/lib/puppet/concat'
|
||||
:concat_basedir => '/var/lib/puppet/concat',
|
||||
:os_workers => '6'
|
||||
}))
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user