Tune workers and thread defaults for better performance
Similar to how we do in devstack gate calculate the workers on the fly instead of defaulting to 1. Also limit the number the threads to a more conservative number. We can override this based on the need. Change-Id: I102f8f73fed997133dc8ecabbc95deca94627a05
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
#
|
||||
# [*workers*]
|
||||
# Number of WSGI workers to spawn.
|
||||
# Optional. Defaults to 1
|
||||
# Optional. Defaults to max(($::processorcount + 0)/4, 2)
|
||||
#
|
||||
# [*priority*]
|
||||
# (optional) The priority for the vhost.
|
||||
@@ -54,7 +54,7 @@
|
||||
#
|
||||
# [*threads*]
|
||||
# (optional) The number of threads for the vhost.
|
||||
# Defaults to $::processorcount
|
||||
# Defaults to 1
|
||||
#
|
||||
# [*ssl_cert*]
|
||||
# [*ssl_key*]
|
||||
@@ -82,7 +82,7 @@ class gnocchi::wsgi::apache (
|
||||
$bind_host = undef,
|
||||
$path = '/',
|
||||
$ssl = true,
|
||||
$workers = 1,
|
||||
$workers = max(($::processorcount + 0)/4, 2),
|
||||
$ssl_cert = undef,
|
||||
$ssl_key = undef,
|
||||
$ssl_chain = undef,
|
||||
@@ -90,7 +90,7 @@ class gnocchi::wsgi::apache (
|
||||
$ssl_crl_path = undef,
|
||||
$ssl_crl = undef,
|
||||
$ssl_certs_dir = undef,
|
||||
$threads = $::processorcount,
|
||||
$threads = 1,
|
||||
$priority = '10',
|
||||
) {
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- gnocchi has been underperforming under apache wsgi.
|
||||
This fix tunes the workers and threads appropriately
|
||||
so we get better performance from apache.
|
||||
@@ -36,6 +36,12 @@ describe 'gnocchi::wsgi::apache' do
|
||||
'docroot_owner' => 'gnocchi',
|
||||
'docroot_group' => 'gnocchi',
|
||||
'ssl' => 'true',
|
||||
'wsgi_daemon_process_options' => {
|
||||
'user' => 'gnocchi',
|
||||
'group' => 'gnocchi',
|
||||
'processes' => '4',
|
||||
'threads' => '1',
|
||||
},
|
||||
'wsgi_daemon_process' => 'gnocchi',
|
||||
'wsgi_process_group' => 'gnocchi',
|
||||
'wsgi_script_aliases' => { '/' => "#{platform_params[:wsgi_script_path]}/app" },
|
||||
@@ -52,6 +58,7 @@ describe 'gnocchi::wsgi::apache' do
|
||||
:port => 12345,
|
||||
:ssl => false,
|
||||
:workers => 37,
|
||||
:threads => 2,
|
||||
}
|
||||
end
|
||||
|
||||
@@ -63,6 +70,12 @@ describe 'gnocchi::wsgi::apache' do
|
||||
'docroot_owner' => 'gnocchi',
|
||||
'docroot_group' => 'gnocchi',
|
||||
'ssl' => 'false',
|
||||
'wsgi_daemon_process_options' => {
|
||||
'user' => 'gnocchi',
|
||||
'group' => 'gnocchi',
|
||||
'processes' => '37',
|
||||
'threads' => '2',
|
||||
},
|
||||
'wsgi_daemon_process' => 'gnocchi',
|
||||
'wsgi_process_group' => 'gnocchi',
|
||||
'wsgi_script_aliases' => { '/' => "#{platform_params[:wsgi_script_path]}/app" },
|
||||
@@ -79,7 +92,7 @@ describe 'gnocchi::wsgi::apache' do
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts({
|
||||
:processorcount => 42,
|
||||
:processorcount => 16,
|
||||
:concat_basedir => '/var/lib/puppet/concat',
|
||||
:fqdn => 'some.host.tld',
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user