diff options
author | Ryan Lucio <rlucio@internap.com> | 2011-01-03 19:49:45 +0000 |
---|---|---|
committer | Tarmac <> | 2011-01-03 19:49:45 +0000 |
commit | 6fc9fdc57cc0c516feec36f594a1fb8460c1c8e0 (patch) | |
tree | 77ec8af4620b76c94f881a6183ff0ba6275d3037 /nova/flags.py | |
parent | 3a54315765861bb883e15c00623752d32560de54 (diff) | |
parent | 5fd9ff898bf372f26bac3c0530521ba7abb7f26c (diff) | |
download | nova-6fc9fdc57cc0c516feec36f594a1fb8460c1c8e0.tar.gz nova-6fc9fdc57cc0c516feec36f594a1fb8460c1c8e0.tar.xz nova-6fc9fdc57cc0c516feec36f594a1fb8460c1c8e0.zip |
Adds the pool_recycle option to the sql engine startup call. This enables connection auto-timeout so that connection pooling will work properly. The recommended setting (per sqlalchemy FAQ page) has been provided as a default for a new configuration flag. What this means is that if a db connection sits idle for the configured # of seconds, the engine will automatically close the connection and return it to the available thread pool. See Bug #690314 for info.
The fix was tested and verified on multi-node deployments of Austin and Bexar with MySQL, and it was also verified that the change does not affect sqlite users (dev environment testing only).
Diffstat (limited to 'nova/flags.py')
-rw-r--r-- | nova/flags.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/flags.py b/nova/flags.py index d773a7e4c..e872ba217 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -263,6 +263,9 @@ DEFINE_string('state_path', os.path.join(os.path.dirname(__file__), '../'), DEFINE_string('sql_connection', 'sqlite:///$state_path/nova.sqlite', 'connection string for sql database') +DEFINE_string('sql_idle_timeout', + '3600', + 'timeout for idle sql database connections') DEFINE_string('compute_manager', 'nova.compute.manager.ComputeManager', 'Manager for compute') |