Correct default number of threads

The default number of threads does not match the default
tested upstream[1], which can return errors for users when
requests begin backing up in the webserver due to a lack
of resources and the nature of the ironic API having some
synchronous requests.

Upstream ironic, as of the Rocky cycle, executed with uwsgi
which is configured for the same process count algorithm,
but enable threds. There does not appear to be an upper bound
to that setting, but accoriding to mod_wsgi documentation[3],
the default is 15 threads. The example shipped with ironic[4]
defaults to 10, which also seems to be a valid configuration.

[1]: https://git.openstack.org/cgit/openstack/ironic/tree/devstack/lib/ironic?h=stable/rocky#n1129
[2]: http://git.openstack.org/cgit/openstack-dev/devstack/tree/lib/apache#n267
[3]: https://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIDaemonProcess.html
[4]: https://git.openstack.org/cgit/openstack/ironic/tree/etc/apache2/ironic?h=stable/rocky#n21

Story: #2003464
Task: #24724
rhbz: #1613995

Change-Id: I327219f96cfc0a69643ab6369cb8e831251f799c
This commit is contained in:
Julia Kreger 2018-08-13 12:37:16 -07:00
parent f505d6fc8b
commit 037cd2cb5d
3 changed files with 13 additions and 4 deletions

View File

@ -50,7 +50,7 @@
#
# [*threads*]
# (optional) The number of threads for the vhost.
# Defaults to 1
# Defaults to 15
#
# [*wsgi_process_display_name*]
# (optional) Name of the WSGI process display-name.
@ -112,7 +112,7 @@ class ironic::wsgi::apache (
$ssl_crl = undef,
$ssl_certs_dir = undef,
$wsgi_process_display_name = undef,
$threads = 1,
$threads = 15,
$priority = '10',
$access_log_file = false,
$access_log_format = false,

View File

@ -0,0 +1,9 @@
---
fixes:
- |
Fixes default configuration where only a single concurrent thread was
permitted per WSGI worker process, which does not match the upstream
configuration where threads are enabled per each spawned worker process.
This allows for greater request concurrency to prevent situations where
the webserver may incorrectly return a 500 error due to the server being
unable to process the request in time.

View File

@ -14,7 +14,7 @@ describe 'ironic::wsgi::apache' do
:path => '/',
:servername => facts[:fqdn],
:ssl => true,
:threads => 1,
:threads => 15,
:user => 'ironic',
:workers => facts[:os_workers],
:wsgi_daemon_process => 'ironic',
@ -56,7 +56,7 @@ describe 'ironic::wsgi::apache' do
:path => '/',
:servername => 'dummy.host',
:ssl => false,
:threads => 1,
:threads => 15,
:user => 'ironic',
:workers => 37,
:wsgi_daemon_process => 'ironic',