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.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819424
Change-Id: I36f5315ad27904c817f4349151fca4181180e811
This commit is contained in:
Damian Dabrowski 2021-12-02 19:21:30 +01:00
parent 00e386a1a7
commit 68bdc789cb
2 changed files with 9 additions and 1 deletions

View File

@ -103,6 +103,10 @@ tacker_galera_user: tacker
tacker_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
tacker_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('') }}"
tacker_galera_port: "{{ galera_port | default('3306') }}"
tacker_db_max_overflow: "{{ openstack_db_max_overflow | default('50') }}"
tacker_db_max_pool_size: "{{ openstack_db_max_pool_size | default('5') }}"
tacker_db_pool_timeout: "{{ openstack_db_pool_timeout | default('30') }}"
tacker_db_connection_recycle_time: "{{ openstack_db_connection_recycle_time | default('600') }}"
tacker_role_name: admin
tacker_bind_address: "{{ openstack_service_bind_address | default('0.0.0.0') }}"

View File

@ -69,7 +69,11 @@ service_token_roles = {{ tacker_role_name }}
# be set in the corresponding core plugin '.ini' file. However, it is suggested
# to put the [database] section and its connection attribute in this
# configuration file.
connection = mysql+pymysql://{{ tacker_galera_user }}:{{ tacker_container_mysql_password }}@{{ tacker_galera_address }}/{{ tacker_galera_database }}?charset=utf8{% if tacker_galera_use_ssl | bool %}&ssl_verify_cert=true{% if tacker_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ tacker_galera_ssl_ca_cert }}{% endif %}{% endif %}
connection = mysql+pymysql://{{ tacker_galera_user }}:{{ tacker_container_mysql_password }}@{{ tacker_galera_address }}/{{ tacker_galera_database }}?charset=utf8{% if tacker_galera_use_ssl | bool %}&ssl_verify_cert=true{% if tacker_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ tacker_galera_ssl_ca_cert }}{% endif %}{% endif +%}
max_overflow = {{ tacker_db_max_overflow }}
max_pool_size = {{ tacker_db_max_pool_size }}
pool_timeout = {{ tacker_db_pool_timeout }}
connection_recycle_time = {{ tacker_db_connection_recycle_time }}
[tacker]