Browse Source

Set threads=1 for api wsgi

This adds some attributes for adjusting the thread counts for each wsgi
application. By default we use 10 threads, however for the api service, it needs
to be set to 1 due to this upstream issue [1]. In addition, increase the
processes for the api service to 6 to account for the reduction in threads.

[1] https://docs.openstack.org/releasenotes/nova/stein.html#known-issues

Change-Id: Iebf78d24c57a069eabced1bf35051cbae5014902
changes/69/717869/2
Lance Albertson 1 year ago
parent
commit
50be0465fe
8 changed files with 23 additions and 2 deletions
  1. +9
    -0
      attributes/default.rb
  2. +2
    -0
      recipes/api-metadata.rb
  3. +2
    -0
      recipes/api-os-compute.rb
  4. +2
    -0
      recipes/placement_api.rb
  5. +2
    -0
      spec/api-metadata_spec.rb
  6. +3
    -1
      spec/api-os-compute_spec.rb
  7. +2
    -0
      spec/placement_api_spec.rb
  8. +1
    -1
      templates/default/wsgi-template.conf.erb

+ 9
- 0
attributes/default.rb View File

@ -41,6 +41,15 @@ default['openstack']['compute']['rootwrap']['syslog_log_level'] = 'ERROR'
default['openstack']['compute'][service]['ssl']['ciphers'] = ''
end
# Work around upstream issue with running the api service under wsgi
# https://docs.openstack.org/releasenotes/nova/stein.html#known-issues
default['openstack']['compute']['api']['threads'] = 1
default['openstack']['compute']['api']['processes'] = 6
default['openstack']['compute']['placement']['threads'] = 10
default['openstack']['compute']['placement']['processes'] = 2
default['openstack']['compute']['metadata']['threads'] = 10
default['openstack']['compute']['metadata']['processes'] = 2
# Platform specific settings
case node['platform_family']
when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this


+ 2
- 0
recipes/api-metadata.rb View File

@ -80,6 +80,8 @@ template "#{apache_dir}/sites-available/nova-metadata.conf" do
run_dir: lock_dir,
user: node['openstack']['compute']['user'],
group: node['openstack']['compute']['group'],
processes: node['openstack']['compute']['metadata']['processes'],
threads: node['openstack']['compute']['metadata']['threads'],
use_ssl: node['openstack']['compute']['metadata']['ssl']['enabled'],
cert_file: node['openstack']['compute']['metadata']['ssl']['certfile'],
chain_file: node['openstack']['compute']['metadata']['ssl']['chainfile'],


+ 2
- 0
recipes/api-os-compute.rb View File

@ -88,6 +88,8 @@ template "#{apache_dir}/sites-available/nova-api.conf" do
run_dir: lock_dir,
user: node['openstack']['compute']['user'],
group: node['openstack']['compute']['group'],
processes: node['openstack']['compute']['api']['processes'],
threads: node['openstack']['compute']['api']['threads'],
use_ssl: node['openstack']['compute']['api']['ssl']['enabled'],
cert_file: node['openstack']['compute']['api']['ssl']['certfile'],
chain_file: node['openstack']['compute']['api']['ssl']['chainfile'],


+ 2
- 0
recipes/placement_api.rb View File

@ -75,6 +75,8 @@ template "#{apache_dir}/sites-available/nova-placement.conf" do
run_dir: lock_dir,
user: nova_user,
group: nova_user,
processes: node['openstack']['compute']['placement']['processes'],
threads: node['openstack']['compute']['placement']['threads'],
use_ssl: node['openstack']['compute']['placement']['ssl']['enabled'],
cert_file: node['openstack']['compute']['placement']['ssl']['certfile'],
chain_file: node['openstack']['compute']['placement']['ssl']['chainfile'],


+ 2
- 0
spec/api-metadata_spec.rb View File

@ -48,11 +48,13 @@ describe 'openstack-compute::api-metadata' do
group: 'nova',
key_file: '',
log_dir: '/var/log/apache2',
processes: 2,
protocol: '',
run_dir: '/var/lock/apache2',
server_entry: '/usr/bin/nova-metadata-wsgi',
server_host: '127.0.0.1',
server_port: '8775',
threads: 10,
user: 'nova',
use_ssl: false,
}


+ 3
- 1
spec/api-os-compute_spec.rb View File

@ -57,11 +57,13 @@ describe 'openstack-compute::api-os-compute' do
group: 'nova',
key_file: '',
log_dir: '/var/log/apache2',
processes: 6,
protocol: '',
run_dir: '/var/lock/apache2',
server_entry: '/usr/bin/nova-api-wsgi',
server_host: '127.0.0.1',
server_port: '8774',
threads: 1,
user: 'nova',
use_ssl: false,
}
@ -69,7 +71,7 @@ describe 'openstack-compute::api-os-compute' do
end
[
/<VirtualHost 127.0.0.1:8774>$/,
/WSGIDaemonProcess nova-api processes=2 threads=10 user=nova group=nova display-name=%{GROUP}$/,
/WSGIDaemonProcess nova-api processes=6 threads=1 user=nova group=nova display-name=%{GROUP}$/,
/WSGIProcessGroup nova-api$/,
%r{WSGIScriptAlias / /usr/bin/nova-api-wsgi$},
/WSGIApplicationGroup %{GLOBAL}$/,


+ 2
- 0
spec/placement_api_spec.rb View File

@ -61,11 +61,13 @@ describe 'openstack-compute::placement_api' do
group: 'nova',
key_file: '',
log_dir: '/var/log/apache2',
processes: 2,
protocol: '',
run_dir: '/var/lock/apache2',
server_entry: '/usr/bin/nova-placement-api',
server_host: '127.0.0.1',
server_port: '8778',
threads: 10,
user: 'nova',
use_ssl: false,
}


+ 1
- 1
templates/default/wsgi-template.conf.erb View File

@ -1,7 +1,7 @@
<%= node['openstack']['compute']['custom_template_banner'] %>
<VirtualHost <%= @server_host %>:<%= @server_port %>>
WSGIDaemonProcess <%= @daemon_process %> processes=2 threads=10 user=<%= @user %> group=<%= @group %> display-name=%{GROUP}
WSGIDaemonProcess <%= @daemon_process %> processes=<%= @processes %> threads=<%= @threads %> user=<%= @user %> group=<%= @group %> display-name=%{GROUP}
WSGIProcessGroup <%= @daemon_process %>
WSGIScriptAlias / <%= @server_entry %>
WSGIApplicationGroup %{GLOBAL}


Loading…
Cancel
Save