Make the metadata_workers attribute in metadata_agent.ini configurable.

The default value of metadata_workers in metadata_agent.ini is half of the
number of CPU cores in the computer system. The value will be large only if
there are many CPU cores, which may not be necessary. It should be acceptable
to make this attribute configurable, which follows what has been done for
api_workers and rpc_workers in neutron.conf.

Change-Id: I823b485d72fb74c13e4bce221a256cfed6770d65
This commit is contained in:
gekun 2015-04-21 16:24:51 +08:00 committed by Ma Wen Cheng
parent abcf9b208b
commit e7761b347f
3 changed files with 13 additions and 1 deletions

View File

@ -413,6 +413,11 @@ default['openstack']['network']['vpn']['config_file'] = '/etc/neutron/vpn_agent.
# The name of the secret databag containing the metadata secret
default['openstack']['network']['metadata']['secret_name'] = 'neutron_metadata_secret'
# This attribute is used to designate the number of the separate
# neutron-metadata-agent processes to spawn. If it is not specified explicitly,
# the default value shall be half of the CPU cores.
default['openstack']['network']['metadata']['metadata_workers'] = nil
# ============================= LBaaS Agent Configuration ==================
# node['openstack']['network']['neutron_loadbalancer'] is deprecated. Use

View File

@ -84,6 +84,11 @@ describe 'openstack-network::metadata_agent' do
.and_return('network_metadata_secret_value')
expect(chef_run).to render_file(file.name).with_content(/^metadata_proxy_shared_secret = network_metadata_secret_value$/)
end
it 'sets the metadata_workers attribute' do
node.set['openstack']['network']['metadata']['metadata_workers'] = 4
expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^metadata_workers = 4$/)
end
end
it 'notifies the metadata agent service' do

View File

@ -42,7 +42,9 @@ metadata_proxy_shared_secret = <%= @metadata_secret %>
# Number of separate worker processes for metadata server. Defaults to
# half the number of CPU cores
# metadata_workers =
<% if node['openstack']['network']['metadata']['metadata_workers'] %>
metadata_workers = <%= node['openstack']['network']['metadata']['metadata_workers'] %>
<% end %>
# Number of backlog requests to configure the metadata server socket with
# metadata_backlog = 4096