Skip to content

Commit

Permalink
Add tuning db configs
Browse files Browse the repository at this point in the history
add min_pool_size, max_pool_size, max_overflow

use the same default values as neutron project

Change-Id: I9cc7744b10be03253e1dfe1efa58278d3c8539e8
  • Loading branch information
trihoangvo committed Sep 25, 2014
1 parent a4fb2d2 commit aaf2567
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@
# [*retry_interval*]
# DEPRECATED: Use database_retry_interval instead.
#
# [*database_min_pool_size*]
# (optional) Minimum number of SQL connections to keep open in a pool.
# Defaults to: 1
#
# [*database_max_pool_size*]
# (optional) Maximum number of SQL connections to keep open in a pool.
# Defaults to: 10
#
# [*database_max_overflow*]
# (optional) If set, use this value for max_overflow with sqlalchemy.
# Defaults to: 20
#
# [*sync_db*]
# (optional) Run neutron-db-manage on api nodes after installing the package.
# Defaults to false
Expand Down Expand Up @@ -158,6 +170,9 @@
$database_max_retries = 10,
$database_idle_timeout = 3600,
$database_retry_interval = 10,
$database_min_pool_size = 1,
$database_max_pool_size = 10,
$database_max_overflow = 20,
$sync_db = false,
$api_workers = $::processorcount,
$rpc_workers = $::processorcount,
Expand Down Expand Up @@ -285,6 +300,9 @@
'database/idle_timeout': value => $database_idle_timeout_real;
'database/retry_interval': value => $database_retry_interval_real;
'database/max_retries': value => $database_max_retries_real;
'database/min_pool_size': value => $database_min_pool_size;
'database/max_pool_size': value => $database_max_pool_size;
'database/max_overflow': value => $database_max_overflow;
}

if ($::neutron::params::server_package) {
Expand Down
6 changes: 6 additions & 0 deletions spec/classes/neutron_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
:database_max_retries => '10',
:database_idle_timeout => '3600',
:database_retry_interval => '10',
:database_min_pool_size => '1',
:database_max_pool_size => '10',
:database_max_overflow => '20',
:sync_db => false,
:agent_down_time => '75',
:router_scheduler_driver => 'neutron.scheduler.l3_agent_scheduler.ChanceScheduler',
Expand All @@ -40,6 +43,9 @@
should contain_neutron_config('database/max_retries').with_value(p[:database_max_retries])
should contain_neutron_config('database/idle_timeout').with_value(p[:database_idle_timeout])
should contain_neutron_config('database/retry_interval').with_value(p[:database_retry_interval])
should contain_neutron_config('database/min_pool_size').with_value(p[:database_min_pool_size])
should contain_neutron_config('database/max_pool_size').with_value(p[:database_max_pool_size])
should contain_neutron_config('database/max_overflow').with_value(p[:database_max_overflow])
end

it { should contain_class('neutron::params') }
Expand Down

0 comments on commit aaf2567

Please sign in to comment.