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: Ib445e0ddd01d52314e50ca6edd2fa20e5f6ef3eb
This commit is contained in:
Damian Dabrowski 2021-12-02 19:19:11 +01:00
parent 53a3fa0672
commit 210cfc5f8f
2 changed files with 9 additions and 1 deletions

View File

@ -70,6 +70,10 @@ cinder_galera_database: cinder
cinder_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
cinder_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('') }}"
cinder_galera_port: "{{ galera_port | default('3306') }}"
cinder_db_max_overflow: "{{ openstack_db_max_overflow | default('50') }}"
cinder_db_max_pool_size: "{{ openstack_db_max_pool_size | default('5') }}"
cinder_db_pool_timeout: "{{ openstack_db_pool_timeout | default('30') }}"
cinder_db_connection_recycle_time: "{{ openstack_db_connection_recycle_time | default('600') }}"
## Oslo Messaging

View File

@ -115,7 +115,11 @@ allowed_direct_url_schemes = cinder
target_helper = {{ cinder_target_helper }}
[database]
connection = mysql+pymysql://{{ cinder_galera_user }}:{{ cinder_container_mysql_password }}@{{ cinder_galera_address }}/{{ cinder_galera_database }}?charset=utf8{% if cinder_galera_use_ssl | bool %}&ssl_verify_cert=true{% if cinder_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ cinder_galera_ssl_ca_cert }}{% endif %}{% endif %}
connection = mysql+pymysql://{{ cinder_galera_user }}:{{ cinder_container_mysql_password }}@{{ cinder_galera_address }}/{{ cinder_galera_database }}?charset=utf8{% if cinder_galera_use_ssl | bool %}&ssl_verify_cert=true{% if cinder_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ cinder_galera_ssl_ca_cert }}{% endif %}{% endif +%}
max_overflow = {{ cinder_db_max_overflow }}
max_pool_size = {{ cinder_db_max_pool_size }}
pool_timeout = {{ cinder_db_pool_timeout }}
connection_recycle_time = {{ cinder_db_connection_recycle_time }}
[oslo_messaging_notifications]
driver = {{ (cinder_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }}