From ac6e4e999b61760ed0c316e8ff77c31a5ab04682 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 30 Jun 2020 23:06:22 +0900 Subject: [PATCH] Use workers instead of threads in wsgi by default In most of puppet-openstack modules, we use workers instead of threads in wsgi to realize concurrency of api process by default. This patch makes puppet-placement follow that standard configuration, so that the default setup can be more consistent among all modules. Change-Id: I7be4c1a5a61fcb8236d58804b9502cf7e3d0718b --- manifests/wsgi/apache.pp | 8 ++++---- releasenotes/notes/wsgi-use-workers-b096fb4e67ad72d2.yaml | 5 +++++ spec/classes/placement_wsgi_apache.rb | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/wsgi-use-workers-b096fb4e67ad72d2.yaml diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 9ad5990..8760002 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -44,7 +44,7 @@ # # [*workers*] # (Optional) Number of WSGI workers to spawn. -# Defaults to 1 +# Defaults to $::os_workers # # [*priority*] # (Optional) The priority for the vhost. @@ -52,7 +52,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. @@ -96,9 +96,9 @@ class placement::wsgi::apache ( $bind_host = undef, $path = '/placement', $ssl = true, - $workers = 1, + $workers = $::os_workers, $priority = '10', - $threads = $::os_workers, + $threads = 1, $wsgi_process_display_name = undef, $ensure_package = 'present', $ssl_cert = undef, diff --git a/releasenotes/notes/wsgi-use-workers-b096fb4e67ad72d2.yaml b/releasenotes/notes/wsgi-use-workers-b096fb4e67ad72d2.yaml new file mode 100644 index 0000000..b4de03d --- /dev/null +++ b/releasenotes/notes/wsgi-use-workers-b096fb4e67ad72d2.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + In wsgi configuration, now workers is used to define concurrency by default + instead of threads, to be consistent with the other puppet modules. diff --git a/spec/classes/placement_wsgi_apache.rb b/spec/classes/placement_wsgi_apache.rb index 89182cc..aec7a84 100644 --- a/spec/classes/placement_wsgi_apache.rb +++ b/spec/classes/placement_wsgi_apache.rb @@ -33,9 +33,9 @@ describe 'placement::wsgi::apache' do :ssl_crl => nil, :ssl_crl_path => nil, :ssl_key => nil, - :threads => facts[:os_workers], + :threads => 1, :user => 'placement', - :workers => 1, + :workers => facts[:os_workers], :wsgi_daemon_process => 'placement-api', :wsgi_process_display_name => nil, :wsgi_process_group => 'placement-api',