]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Expose most common QueuePoll parameters from SQLAlchemy
authorGary Kotton <gkotton@redhat.com>
Tue, 4 Jun 2013 15:14:39 +0000 (15:14 +0000)
committerGary Kotton <gkotton@redhat.com>
Thu, 6 Jun 2013 11:05:07 +0000 (11:05 +0000)
Fixes bug 1160442

The defualt parameters are used unless otherwise configured. This
is applicable for:
 - pool_size
 - max_overflow
 - pool_timeout

By increasing the pool_size and the max_overflow and lowering the timeout
the issue reported in the bug is resolved.

NOTE: the configuration values enable the user to make use of the default
QueuePool tuning values.

Change-Id: Ic258442531a2caf2db4f05c4ddd6fbfb0c180f17

13 files changed:
etc/quantum/plugins/bigswitch/restproxy.ini
etc/quantum/plugins/brocade/brocade.ini
etc/quantum/plugins/hyperv/hyperv_quantum_plugin.ini
etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini
etc/quantum/plugins/metaplugin/metaplugin.ini
etc/quantum/plugins/midonet/midonet.ini
etc/quantum/plugins/ml2/ml2_conf.ini
etc/quantum/plugins/nec/nec.ini
etc/quantum/plugins/nicira/nvp.ini
etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini
etc/quantum/plugins/plumgrid/plumgrid.ini
etc/quantum/plugins/ryu/ryu.ini
quantum/db/api.py

index 74a8e619d4ebecc684e6c4519180c63f50eda2e4..86ff66671a02dd29e35bd58c878eb2e3c1bac73a 100644 (file)
@@ -23,7 +23,11 @@ reconnect_interval = 2
 # Timeout in seconds before idle sql connections are reaped
 # sql_idle_timeout = 3600
 # Maximum number of SQL connections to keep open in a QueuePool in SQLAlchemy
-# sqlalchemy_pool_size = 5
+# Example sqlalchemy_pool_size = 5
+# Maximum number of overflow connections in a QueuePool in SQLAlchemy
+# Example sqlalchemy_max_overflow = 10
+# Timeout of the open connections QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_timeout = 30
 
 [RESTPROXY]
 # All configuration for this plugin is in section '[restproxy]'
index 05d5b0ea1095503127a731b85285cec45813ff6e..69d30468eb0fe0c2bcb752acf71fb4991978214b 100644 (file)
 # Timeout in seconds before idle sql connections are reaped
 # sql_idle_timeout = 3600
 # Maximum number of SQL connections to keep open in a QueuePool in SQLAlchemy
-# sqlalchemy_pool_size = 5
+# Example sqlalchemy_pool_size = 5
+# Maximum number of overflow connections in a QueuePool in SQLAlchemy
+# Example sqlalchemy_max_overflow = 10
+# Timeout of the open connections QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_timeout = 30
 #
 # Example:
 # sql_connection = mysql://root:pass@localhost/brcd_quantum?charset=utf8
index 89fdf89a3f0cbf543de7778191e9d50e5f14d42a..ea12178ca4858820f3f1065ebfd82fd80f37bd14 100644 (file)
@@ -21,7 +21,11 @@ reconnect_interval = 2
 # Timeout in seconds before idle sql connections are reaped
 # sql_idle_timeout = 3600
 # Maximum number of SQL connections to keep open in a QueuePool in SQLAlchemy
-# sqlalchemy_pool_size = 5
+# Example sqlalchemy_pool_size = 5
+# Maximum number of overflow connections in a QueuePool in SQLAlchemy
+# Example sqlalchemy_max_overflow = 10
+# Timeout of the open connections QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_timeout = 30
 
 [HYPERV]
 # (StrOpt) Type of network to allocate for tenant networks. The
index 21c01f950d76c1e7ac846c4ef8b7a7f5b4609fc9..d7ed755a1f7311037eaeeba5fb2e26f4c026f6b0 100644 (file)
@@ -43,7 +43,11 @@ reconnect_interval = 2
 # Timeout in seconds before idle sql connections are reaped
 # sql_idle_timeout = 3600
 # Maximum number of SQL connections to keep open in a QueuePool in SQLAlchemy
-# sqlalchemy_pool_size = 5
+# Example sqlalchemy_pool_size = 5
+# Maximum number of overflow connections in a QueuePool in SQLAlchemy
+# Example sqlalchemy_max_overflow = 10
+# Timeout of the open connections QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_timeout = 30
 
 [LINUX_BRIDGE]
 # (ListOpt) Comma-separated list of
index ede07aa01a0947ea1a8793063d51c23e0fd23a42..f17588cbbeb80e81cfa798669f805c216f392df4 100644 (file)
@@ -23,7 +23,11 @@ reconnect_interval = 2
 # Timeout in seconds before idle sql connections are reaped
 # sql_idle_timeout = 3600
 # Maximum number of SQL connections to keep open in a QueuePool in SQLAlchemy
-# sqlalchemy_pool_size = 5
+# Example sqlalchemy_pool_size = 5
+# Maximum number of overflow connections in a QueuePool in SQLAlchemy
+# Example sqlalchemy_max_overflow = 10
+# Timeout of the open connections QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_timeout = 30
 
 [META]
 ## This is list of flavor:quantum_plugins
index 529ab9a196a20b90e56fb0cde87c3e1597d9bc47..11a0105b8d28f0f44ddf63b36f5b3667f70024e4 100644 (file)
@@ -21,7 +21,11 @@ reconnect_interval = 2
 # Timeout in seconds before idle sql connections are reaped
 # sql_idle_timeout = 3600
 # Maximum number of SQL connections to keep open in a QueuePool in SQLAlchemy
-# sqlalchemy_pool_size = 5
+# Example sqlalchemy_pool_size = 5
+# Maximum number of overflow connections in a QueuePool in SQLAlchemy
+# Example sqlalchemy_max_overflow = 10
+# Timeout of the open connections QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_timeout = 30
 
 [MIDONET]
 # MidoNet API server URI
index 61a111ea38c96eaa015ff140e2033d664b44084e..d2498328f7f825ef1b210d92876825dcc7941611 100644 (file)
 # sql_idle_timeout = 3600
 # Example: sql_idle_timeout = 6000
 
-# (IntOpt) Maximum number of SQL connections to keep open in a
-# QueuePool in SQLAlchemy.
-#
-# sqlalchemy_pool_size = 5
-# Example: sqlalchemy_pool_size = 10
+# Maximum number of SQL connections to keep open in a QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_size = 5
+# Maximum number of overflow connections in a QueuePool in SQLAlchemy
+# Example sqlalchemy_max_overflow = 10
+# Timeout of the open connections QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_timeout = 30
 
 [ml2]
 # (ListOpt) List of network type driver entrypoints to be loaded from
index 22da0b03ff378b44ac3b6c9546afae86b88df4e1..bb84bc5ee6f76dab3383d5f6a6096c2a4cfc4a76 100644 (file)
@@ -23,7 +23,11 @@ reconnect_interval = 2
 # Timeout in seconds before idle sql connections are reaped
 # sql_idle_timeout = 3600
 # Maximum number of SQL connections to keep open in a QueuePool in SQLAlchemy
-# sqlalchemy_pool_size = 5
+# Example sqlalchemy_pool_size = 5
+# Maximum number of overflow connections in a QueuePool in SQLAlchemy
+# Example sqlalchemy_max_overflow = 10
+# Timeout of the open connections QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_timeout = 30
 
 [OVS]
 # Do not change this parameter unless you have a good reason to.
index c784f7bdf416281814e59596f7bdd7042c2262fe..7de0125f5de6cda25ee75dcb9dffbffd450da1e4 100644 (file)
@@ -91,8 +91,13 @@ sql_connection = sqlite://
 # sql_idle_timeout = 3600
 
 # Maximum number of SQL connections to keep open in a QueuePool in SQLAlchemy
-# sqlalchemy_pool_size = 5
+# Example sqlalchemy_pool_size = 5
 
+# Maximum number of overflow connections in a QueuePool in SQLAlchemy
+# Example sqlalchemy_max_overflow = 10
+
+# Timeout of the open connections QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_timeout = 30
 
 [QUOTAS]
 # number of network gateways allowed per tenant, -1 means unlimited
index da7f8150d31a0066fc250f830f36b8f6cf1c471a..4813a0a58dd66f985bed70a5dec08a1796666819 100644 (file)
@@ -21,7 +21,11 @@ reconnect_interval = 2
 # Timeout in seconds before idle sql connections are reaped
 # sql_idle_timeout = 3600
 # Maximum number of SQL connections to keep open in a QueuePool in SQLAlchemy
-# sqlalchemy_pool_size = 5
+# Example sqlalchemy_pool_size = 5
+# Maximum number of overflow connections in a QueuePool in SQLAlchemy
+# Example sqlalchemy_max_overflow = 10
+# Timeout of the open connections QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_timeout = 30
 
 [OVS]
 # (StrOpt) Type of network to allocate for tenant networks. The
index 564427b23e526529dc879cf78b25e0412e63759b..a6d2013f4966979d23a50d727553bb37fd9e148f 100644 (file)
 # Timeout in seconds before idle sql connections are reaped
 # sql_idle_timeout = 3600
 # Maximum number of SQL connections to keep open in a QueuePool in SQLAlchemy
-# sqlalchemy_pool_size = 5
+# Example sqlalchemy_pool_size = 5
+# Maximum number of overflow connections in a QueuePool in SQLAlchemy
+# Example sqlalchemy_max_overflow = 10
+# Timeout of the open connections QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_timeout = 30
 
 [PLUMgridNOS]
 # This line should be pointing to the NOS server,
index 4c42b9698291eccf99e598240ecd9b9c198baf8b..e8636627872405e0fa4bad24141703bec72ff5a2 100644 (file)
@@ -13,7 +13,11 @@ sql_connection = sqlite://
 # Timeout in seconds before idle sql connections are reaped
 # sql_idle_timeout = 3600
 # Maximum number of SQL connections to keep open in a QueuePool in SQLAlchemy
-# sqlalchemy_pool_size = 5
+# Example sqlalchemy_pool_size = 5
+# Maximum number of overflow connections in a QueuePool in SQLAlchemy
+# Example sqlalchemy_max_overflow = 10
+# Timeout of the open connections QueuePool in SQLAlchemy
+# Example sqlalchemy_pool_timeout = 30
 
 [OVS]
 integration_bridge = br-int
index de827285a0dfdafd7dd60bd7cf89440b76d86c5f..5e27696340d7b3ca2b58244dc1e05e2fd337bc05 100644 (file)
@@ -64,9 +64,17 @@ database_opts = [
                 default=False,
                 help=_("Enable the use of eventlet's db_pool for MySQL")),
     cfg.IntOpt('sqlalchemy_pool_size',
-               default=5,
+               default=None,
                help=_("Maximum number of SQL connections to keep open in a "
                       "QueuePool in SQLAlchemy")),
+    cfg.IntOpt('sqlalchemy_max_overflow',
+               default=None,
+               help=_("If set, use this value for max_overflow with "
+                      "sqlalchemy")),
+    cfg.IntOpt('sqlalchemy_pool_timeout',
+               default=None,
+               help=_("If set, use this value for pool_timeout with "
+                      "sqlalchemy")),
 ]
 
 cfg.CONF.register_opts(database_opts, "DATABASE")
@@ -124,9 +132,18 @@ def configure_db():
             'pool_recycle': 3600,
             'echo': False,
             'convert_unicode': True,
-            'pool_size': cfg.CONF.DATABASE.sqlalchemy_pool_size,
         }
 
+        if cfg.CONF.DATABASE.sqlalchemy_pool_size is not None:
+            pool_size = cfg.CONF.DATABASE.sqlalchemy_pool_size
+            engine_args['pool_size'] = pool_size
+        if cfg.CONF.DATABASE.sqlalchemy_max_overflow is not None:
+            max_overflow = cfg.CONF.DATABASE.sqlalchemy_max_overflow
+            engine_args['max_overflow'] = max_overflow
+        if cfg.CONF.DATABASE.sqlalchemy_pool_timeout is not None:
+            pool_timeout = cfg.CONF.DATABASE.sqlalchemy_pool_timeout
+            engine_args['pool_timeout'] = pool_timeout
+
         if 'mysql' in connection_dict.drivername:
             engine_args['listeners'] = [MySQLPingListener()]
             if (MySQLdb is not None and