From 855a5c8e44a7ee7b15c3fe39198b98bd54fc70f7 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 5 Jul 2020 00:07:33 +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-watcher follow that standard configuration, so that the default setup can be more consistent among all modules. Change-Id: Iac7cba33f69b39e5bf29c61ed0c22b9b533b1293 --- manifests/wsgi/apache.pp | 8 ++++---- releasenotes/notes/wsgi-use-workers-02a0232bf3aac3fe.yaml | 5 +++++ spec/classes/watcher_wsgi_apache_spec.rb | 6 +++--- 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/wsgi-use-workers-02a0232bf3aac3fe.yaml diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index f432893..da5bcc6 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -42,7 +42,7 @@ # # [*workers*] # Number of WSGI workers to spawn. -# Optional. Defaults to 1 +# Optional. Defaults to $::os_workers # # [*priority*] # (optional) The priority for the vhost. @@ -50,7 +50,7 @@ # # [*threads*] # (optional) The number of threads for the vhost. -# Defaults to $::os_workers +# Defaults to 1 # # [*access_log_file*] # The log file name for the virtualhost. @@ -102,7 +102,7 @@ class watcher::wsgi::apache ( $bind_host = undef, $path = '/', $ssl = true, - $workers = 1, + $workers = $::os_workers, $ssl_cert = undef, $ssl_key = undef, $ssl_chain = undef, @@ -111,7 +111,7 @@ class watcher::wsgi::apache ( $ssl_crl = undef, $ssl_certs_dir = undef, $wsgi_process_display_name = undef, - $threads = $::os_workers, + $threads = 1, $priority = '10', $access_log_file = false, $access_log_format = false, diff --git a/releasenotes/notes/wsgi-use-workers-02a0232bf3aac3fe.yaml b/releasenotes/notes/wsgi-use-workers-02a0232bf3aac3fe.yaml new file mode 100644 index 0000000..b4de03d --- /dev/null +++ b/releasenotes/notes/wsgi-use-workers-02a0232bf3aac3fe.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/watcher_wsgi_apache_spec.rb b/spec/classes/watcher_wsgi_apache_spec.rb index 4391d72..f3e0886 100644 --- a/spec/classes/watcher_wsgi_apache_spec.rb +++ b/spec/classes/watcher_wsgi_apache_spec.rb @@ -14,9 +14,9 @@ describe 'watcher::wsgi::apache' do :path => '/', :servername => facts[:fqdn], :ssl => true, - :threads => facts[:os_workers], + :threads => 1, :user => 'watcher', - :workers => 1, + :workers => facts[:os_workers], :wsgi_daemon_process => 'watcher', :wsgi_process_group => 'watcher', :wsgi_script_dir => platform_params[:wsgi_script_path], @@ -56,7 +56,7 @@ describe 'watcher::wsgi::apache' do :path => '/', :servername => 'dummy.host', :ssl => false, - :threads => facts[:os_workers], + :threads => 1, :user => 'watcher', :workers => 37, :wsgi_daemon_process => 'watcher',