From b903c1a8c3245c23abfd8b8d380a991ae0cf02fd Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Thu, 3 Apr 2014 15:43:26 -0500 Subject: [PATCH] Add rpc options Add rpc_thread_pool_size, rpc_conn_pool_size and rpc_response_timeout Change-Id: Iba940171f1dd0f2d6c773a72ffa5720e89733ca5 Closes-Bug: #1302164 --- CHANGELOG.md | 1 + attributes/default.rb | 5 +++++ spec/server_spec.rb | 16 +++++++++++++++- templates/default/neutron.conf.erb | 6 +++--- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0818e72..2c188cbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ This file is used to list changes made in each version of cookbook-openstack-net * Upgrade to Icehouse * The balancer recipe now includes openstack-network::common * Neutron agents now subscribe to changes in neutron.conf +* Add rpc attributes ## 8.5.1 ### Bug diff --git a/attributes/default.rb b/attributes/default.rb index 8fff9589..a59f24d5 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -179,6 +179,11 @@ default['openstack']['network']['dhcp_lease_duration'] = 86400 # Driver or drivers to handle sending notifications default['openstack']['network']['notification_driver'] = 'neutron.openstack.common.notifier.rpc_notifier' +# Common rpc definitions +default['openstack']['network']['rpc_thread_pool_size'] = 64 +default['openstack']['network']['rpc_conn_pool_size'] = 30 +default['openstack']['network']['rpc_response_timeout'] = 60 + # ============================= DHCP Agent Configuration =================== # The scheduler class to use for scheduling to DHCP agents diff --git a/spec/server_spec.rb b/spec/server_spec.rb index 713621f4..c9fd4154 100644 --- a/spec/server_spec.rb +++ b/spec/server_spec.rb @@ -54,7 +54,6 @@ describe 'openstack-network::server' do expect(chef_run).not_to install_package 'neutron-plugin-openvswitch-agent' expect(chef_run).not_to enable_service 'neutron-plugin-openvswitch-agent' end - end describe 'api-paste.ini' do @@ -88,6 +87,21 @@ describe 'openstack-network::server' do ) end + it 'it sets rpc_thread_pool_size correctly' do + expect(chef_run).to render_file(file.name).with_content( + 'rpc_thread_pool_size = 64') + end + + it 'it sets rpc_conn_pool_size correctly' do + expect(chef_run).to render_file(file.name).with_content( + 'rpc_conn_pool_size = 30') + end + + it 'it sets rpc_response_timeout correctly' do + expect(chef_run).to render_file(file.name).with_content( + 'rpc_response_timeout = 60') + end + it 'it sets agent_down_time correctly' do expect(chef_run).to render_file(file.name).with_content( 'agent_down_time = 75') diff --git a/templates/default/neutron.conf.erb b/templates/default/neutron.conf.erb index 52eecd95..c6b55e61 100644 --- a/templates/default/neutron.conf.erb +++ b/templates/default/neutron.conf.erb @@ -101,11 +101,11 @@ dhcp_lease_duration = <%= node["openstack"]["network"]["dhcp_lease_duration"] %> # The messaging module to use, defaults to kombu. # rpc_backend = neutron.openstack.common.rpc.impl_kombu # Size of RPC thread pool -# rpc_thread_pool_size = 64, +rpc_thread_pool_size = <%= node['openstack']['network']['rpc_thread_pool_size'] -%> # Size of RPC connection pool -# rpc_conn_pool_size = 30 +rpc_conn_pool_size = <%= node['openstack']['network']['rpc_conn_pool_size'] -%> # Seconds to wait for a response from call or multicall -# rpc_response_timeout = 60 +rpc_response_timeout = <%= node['openstack']['network']['rpc_response_timeout'] -%> # Seconds to wait before a cast expires (TTL). Only supported by impl_zmq. # rpc_cast_timeout = 30 # Modules of exceptions that are permitted to be recreated