Skip to content

Commit

Permalink
Issue #665: Attributes for sql pool settings
Browse files Browse the repository at this point in the history
Expose some Nova SQL attributes:

 - connection_debug=0
 - idle_timeout=3600
 - max_pool_size=None
 - max_overflow=None
 - max_retries=10
 - min_pool_size=1
 - retry_interval=10

NB!: These options are different in Grizzly (DO NOT MERGE TO v4.1.X).
  • Loading branch information
brc committed Dec 3, 2013
1 parent b4b3e80 commit 2e27e75
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 3 deletions.
31 changes: 30 additions & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,43 @@
default["nova"]["config"]["reserved_host_disk_mb"] = 0

# LOGGING VERBOSITY
#
# in order of verbosity (most to least)
# DEBUG, INFO, WARNING, ERROR, CRITICAL
default["nova"]["config"]["log_verbosity"] = "INFO"

# quota settings
# QUOTA SETTINGS
#
default["nova"]["config"]["quota_security_groups"] = 50
default["nova"]["config"]["quota_security_group_rules"] = 20

# DB CONNECTION SETTINGS
#
# (IntOpt) Verbosity of SQL debugging information. 0=None, 100=Everything
default["nova"]["config"]["sql_connection_debug"] = 0

# (IntOpt) Timeout before idle sql connections are reaped
default["nova"]["config"]["sql_idle_timeout"] = 3600

# (IntOpt) Interval between retries of opening a sql connection
default["nova"]["config"]["sql_retry_interval"] = 10

# (IntOpt) Maximum db connection retries during startup.
# Setting -1 implies an infinite retry count.
default["nova"]["config"]["sql_max_retries"] = 10

# (IntOpt) Minimum number of SQL connections to keep open in a pool
default["nova"]["config"]["sql_min_pool_size"] = 1

# (IntOpt) If set, Maximum number of SQL connections to keep open in a pool
#default["nova"]["config"]["sql_max_pool_size"] = 5

# (IntOpt) If set, use this value for max_overflow with sqlalchemy
# http://docs.sqlalchemy.org/en/rel_0_9/core/pooling.html#sqlalchemy.pool.QueuePool
#default["nova"]["config"]["sql_max_overflow"] = 10

# NOVA RATELIMIT SETTINGS
#
default["nova"]["ratelimit"]["settings"] = {
"generic-post-limit" => { "verb" => "POST", "uri" => "*", "regex" => ".*", "limit" => "10", "interval" => "MINUTE" },
"create-servers-limit" => { "verb" => "POST", "uri" => "*/servers", "regex" => "^/servers", "limit" => "50", "interval" => "DAY" },
Expand Down
9 changes: 8 additions & 1 deletion providers/conf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,14 @@
"memcached_servers" => memcached_servers,
"image_cache_manager_interval" => node["nova"]["config"]["image_cache_manager_interval"],
"max_age" => node["nova"]["config"]["max_age"],
"reserved_host_disk_mb" => node["nova"]["config"]["reserved_host_disk_mb"]
"reserved_host_disk_mb" => node["nova"]["config"]["reserved_host_disk_mb"],
"sql_connection_debug" => node["nova"]["config"]["sql_connection_debug"],
"sql_idle_timeout" => node["nova"]["config"]["sql_idle_timeout"],
"sql_retry_interval" => node["nova"]["config"]["sql_retry_interval"],
"sql_max_retries" => node["nova"]["config"]["sql_max_retries"],
"sql_min_pool_size" => node["nova"]["config"]["sql_min_pool_size"],
"sql_max_pool_size" => node["nova"]["config"]["sql_max_pool_size"] || nil,
"sql_max_overflow" => node["nova"]["config"]["sql_max_overflow"] || nil
)
end
new_resource.updated_by_last_action(t.updated_by_last_action?)
Expand Down
16 changes: 15 additions & 1 deletion templates/default/nova.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ ec2_private_dns_show_ip=True
<% if @iscsi_use_multipath == true -%>
##### EMC Multi-Path ####
libvirt_iscsi_use_multipath = "True"
<% end %>
<% end -%>

##### CEILOMETER #####
<% if @use_ceilometer.to_s.capitalize() == "True" -%>
Expand All @@ -130,3 +130,17 @@ notification_driver=ceilometer.compute.nova_notifier
<% else -%>
# disabled because ceilometer::ceilometer-compute is not in the run_list
<% end -%>

##### DATABASE CONNECTIONS #####
[DATABASE]
connection_debug=<%= @sql_connection_debug %>
idle_timeout=<%= @sql_idle_timeout %>
retry_interval=<%= @sql_retry_interval %>
max_retries=<%= @sql_max_retries %>
min_pool_size=<%= @sql_min_pool_size %>
<% if @sql_max_pool_size -%>
max_pool_size=<%= @sql_max_pool_size %>
<% end -%>
<% if @sql_max_overflow -%>
max_overflow=<%= @sql_max_overflow %>
<% end -%>

0 comments on commit 2e27e75

Please sign in to comment.