]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
adding parameter to configure QueuePool in SQLAlchemy
authorChristian Berendt <berendt@b1-systems.de>
Thu, 21 Mar 2013 11:06:33 +0000 (12:06 +0100)
committerChristian Berendt <berendt@b1-systems.de>
Thu, 21 Mar 2013 18:41:55 +0000 (19:41 +0100)
This patch introduces the parameter sqlalchemy_pool_size.
The parameter is used to configure the QueuePool, created
in configure_db(). At the moment the configuration of the
pool is only possible when using eventlet's db_pool for
MySQL (sql_dbpool_enable = True).

Change-Id: I64dec2863c1ee88215ef9b28054ba3bfaafa3b32
fixes: bug #1158235

quantum/db/api.py

index d27a0c21c1f716d41be9284bed1956a7b7edca71..82ea55ff5b6e03123a939f92feaafe8f251e7f93 100644 (file)
@@ -62,6 +62,10 @@ database_opts = [
     cfg.BoolOpt('sql_dbpool_enable',
                 default=False,
                 help=_("Enable the use of eventlet's db_pool for MySQL")),
+    cfg.IntOpt('sqlalchemy_pool_size',
+               default=5,
+               help=_("Maximum number of SQL connections to keep open in a "
+                      "QueuePool in SQLAlchemy")),
 ]
 
 cfg.CONF.register_opts(database_opts, "DATABASE")
@@ -122,6 +126,7 @@ def configure_db():
             'pool_recycle': 3600,
             'echo': False,
             'convert_unicode': True,
+            'pool_size': cfg.CONF.DATABASE.sqlalchemy_pool_size,
         }
 
         if 'mysql' in connection_dict.drivername: