Database connection pooling improvements

- Implemented new variable ``connection_recycle_time`` responsible for SQLAlchemy's connection recycling
- Set new default values for db pooling variables which are inherited from the global ones.

Change-Id: Ibc876f2744c271e9c4ad797597c15af8d73867c1
This commit is contained in:
Damian Dabrowski 2021-11-26 12:11:18 +01:00
parent e9f3c79832
commit fcd582731b
3 changed files with 14 additions and 6 deletions

View File

@ -90,9 +90,10 @@ nova_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | de
nova_galera_address: "{{ galera_address | default('127.0.0.1') }}"
nova_galera_user: nova
nova_galera_database: nova
nova_db_max_overflow: 10
nova_db_max_pool_size: 120
nova_db_pool_timeout: 30
nova_db_max_overflow: "{{ openstack_db_max_overflow | default('50') }}"
nova_db_max_pool_size: "{{ openstack_db_max_pool_size | default('5') }}"
nova_db_pool_timeout: "{{ openstack_db_pool_timeout | default('30') }}"
nova_db_connection_recycle_time: "{{ openstack_db_connection_recycle_time | default('600') }}"
nova_galera_port: "{{ galera_port | default('3306') }}"
# Toggle whether nova connects via an encrypted connection
nova_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
@ -104,9 +105,10 @@ nova_api_galera_address: "{{ nova_galera_address }}"
nova_api_galera_user: nova_api
nova_api_galera_database: nova_api
nova_api_galera_port: "{{ galera_port | default('3306') }}"
nova_api_db_max_overflow: 10
nova_api_db_max_pool_size: 120
nova_api_db_pool_timeout: 30
nova_api_db_max_overflow: "{{ openstack_db_max_overflow | default('50') }}"
nova_api_db_max_pool_size: "{{ openstack_db_max_pool_size | default('5') }}"
nova_api_db_pool_timeout: "{{ openstack_db_pool_timeout | default('30') }}"
nova_api_db_connection_recycle_time: "{{ openstack_db_connection_recycle_time | default('600') }}"
## DB Cells
nova_cell0_database: "nova_cell0"

View File

@ -0,0 +1,4 @@
features:
- Implemented new variable ``connection_recycle_time`` responsible for SQLAlchemy's connection recycling
other:
- Set new default values for db pooling variables which are inherited from the global ones.

View File

@ -197,6 +197,7 @@ connection = mysql+pymysql://{{ nova_galera_user }}:{{ nova_container_mysql_pass
max_overflow = {{ nova_db_max_overflow }}
max_pool_size = {{ nova_db_max_pool_size }}
pool_timeout = {{ nova_db_pool_timeout }}
connection_recycle_time = {{ nova_db_connection_recycle_time }}
[api_database]
@ -205,6 +206,7 @@ connection = mysql+pymysql://{{ nova_api_galera_user }}:{{ nova_api_container_my
max_overflow = {{ nova_api_db_max_overflow }}
max_pool_size = {{ nova_api_db_max_pool_size }}
pool_timeout = {{ nova_api_db_pool_timeout }}
connection_recycle_time = {{ nova_api_db_connection_recycle_time }}
{% endif %}