diff --git a/manifests/agents/metadata.pp b/manifests/agents/metadata.pp index 4362910af..686d234f5 100644 --- a/manifests/agents/metadata.pp +++ b/manifests/agents/metadata.pp @@ -50,10 +50,11 @@ # # [*metadata_workers*] # (optional) Number of separate worker processes to spawn. -# The default, 0, runs the worker thread in the current process. +# The default, count of machine's processors, runs the worker thread in the +# current process. # Greater than 0 launches that number of child processes as workers. # The parent process manages them. Having more workers will help to improve performances. -# Defaults to: 0 +# Defaults to: $::processorcount # # [*metadata_backlog*] # (optional) Number of backlog requests to configure the metadata server socket with. @@ -75,7 +76,7 @@ $auth_region = 'RegionOne', $metadata_ip = '127.0.0.1', $metadata_port = '8775', - $metadata_workers = '0', + $metadata_workers = $::processorcount, $metadata_backlog = '4096' ) { diff --git a/manifests/server.pp b/manifests/server.pp index efe6c3c72..3bc0e6e46 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -111,17 +111,19 @@ # # [*api_workers*] # (optional) Number of separate worker processes to spawn. -# The default, 0, runs the worker thread in the current process. +# The default, count of machine's processors, runs the worker thread in the +# current process. # Greater than 0 launches that number of child processes as workers. # The parent process manages them. -# Defaults to: 0 +# Defaults to: $::processorcount # # [*rpc_workers*] # (optional) Number of separate RPC worker processes to spawn. -# The default, 0, runs the worker thread in the current process. +# The default, count of machine's processors, runs the worker thread in the +# current process. # Greater than 0 launches that number of child processes as workers. # The parent process manages them. -# Defaults to: 0 +# Defaults to: $::processorcount # # [*agent_down_time*] # (optional) Seconds to regard the agent as down; should be at least twice @@ -157,8 +159,8 @@ $database_idle_timeout = 3600, $database_retry_interval = 10, $sync_db = false, - $api_workers = '0', - $rpc_workers = '0', + $api_workers = $::processorcount, + $rpc_workers = $::processorcount, $agent_down_time = '75', $router_scheduler_driver = 'neutron.scheduler.l3_agent_scheduler.ChanceScheduler', # DEPRECATED PARAMETERS diff --git a/spec/classes/neutron_agents_metadata_spec.rb b/spec/classes/neutron_agents_metadata_spec.rb index 76807599d..fcdf231fc 100644 --- a/spec/classes/neutron_agents_metadata_spec.rb +++ b/spec/classes/neutron_agents_metadata_spec.rb @@ -18,7 +18,6 @@ :auth_password => 'password', :metadata_ip => '127.0.0.1', :metadata_port => '8775', - :metadata_workers => '2', :metadata_backlog => '4096', :shared_secret => 'metadata-secret' } @@ -58,7 +57,7 @@ should contain_neutron_metadata_agent_config('DEFAULT/admin_password').with_secret( true ) should contain_neutron_metadata_agent_config('DEFAULT/nova_metadata_ip').with(:value => params[:metadata_ip]) should contain_neutron_metadata_agent_config('DEFAULT/nova_metadata_port').with(:value => params[:metadata_port]) - should contain_neutron_metadata_agent_config('DEFAULT/metadata_workers').with(:value => params[:metadata_workers]) + should contain_neutron_metadata_agent_config('DEFAULT/metadata_workers').with(:value => facts[:processorcount]) should contain_neutron_metadata_agent_config('DEFAULT/metadata_backlog').with(:value => params[:metadata_backlog]) should contain_neutron_metadata_agent_config('DEFAULT/metadata_proxy_shared_secret').with(:value => params[:shared_secret]) end @@ -81,7 +80,8 @@ context 'on Debian platforms' do let :facts do - { :osfamily => 'Debian' } + { :osfamily => 'Debian', + :processorcount => '2' } end let :platform_params do @@ -103,7 +103,8 @@ context 'on Red Hat platforms' do let :facts do - { :osfamily => 'RedHat' } + { :osfamily => 'RedHat', + :processorcount => '2' } end let :platform_params do diff --git a/spec/classes/neutron_server_spec.rb b/spec/classes/neutron_server_spec.rb index e2ccc30b2..846ff5130 100644 --- a/spec/classes/neutron_server_spec.rb +++ b/spec/classes/neutron_server_spec.rb @@ -24,8 +24,6 @@ :database_idle_timeout => '3600', :database_retry_interval => '10', :sync_db => false, - :api_workers => '0', - :rpc_workers => '0', :agent_down_time => '75', :router_scheduler_driver => 'neutron.scheduler.l3_agent_scheduler.ChanceScheduler', } @@ -82,8 +80,8 @@ should contain_neutron_api_config('filter:authtoken/auth_admin_prefix').with( :ensure => 'absent' ) - should contain_neutron_config('DEFAULT/api_workers').with_value(p[:api_workers]) - should contain_neutron_config('DEFAULT/rpc_workers').with_value(p[:rpc_workers]) + should contain_neutron_config('DEFAULT/api_workers').with_value(facts[:processorcount]) + should contain_neutron_config('DEFAULT/rpc_workers').with_value(facts[:processorcount]) should contain_neutron_config('DEFAULT/agent_down_time').with_value(p[:agent_down_time]) should contain_neutron_config('DEFAULT/router_scheduler_driver').with_value(p[:router_scheduler_driver]) end @@ -240,7 +238,8 @@ context 'on Debian platforms' do let :facts do - { :osfamily => 'Debian' } + { :osfamily => 'Debian', + :processorcount => '2' } end let :platform_params do @@ -261,7 +260,8 @@ context 'on RedHat platforms' do let :facts do - { :osfamily => 'RedHat' } + { :osfamily => 'RedHat', + :processorcount => '2' } end let :platform_params do