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: Idad975d6ee80c286f59ca69a8f99904bdf7939c9
This commit is contained in:
Damian Dabrowski 2021-12-02 19:21:20 +01:00
parent e4be01a8a3
commit 0e0771d4e2
2 changed files with 9 additions and 1 deletions

View File

@ -59,6 +59,10 @@ senlin_galera_database: senlin
senlin_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
senlin_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('') }}"
senlin_galera_port: "{{ galera_port | default('3306') }}"
senlin_db_max_overflow: "{{ openstack_db_max_overflow | default('50') }}"
senlin_db_max_pool_size: "{{ openstack_db_max_pool_size | default('5') }}"
senlin_db_pool_timeout: "{{ openstack_db_pool_timeout | default('30') }}"
senlin_db_connection_recycle_time: "{{ openstack_db_connection_recycle_time | default('600') }}"
## Oslo Messaging Info
# RPC

View File

@ -37,7 +37,11 @@ engine_life_check_timeout = {{ senlin_engine_life_check_timeout }}
service_down_time = {{ senlin_service_down_time }}
[database]
connection = mysql+pymysql://{{ senlin_galera_user }}:{{ senlin_galera_password }}@{{ senlin_galera_address }}/{{ senlin_galera_database }}?charset=utf8{% if senlin_galera_use_ssl | bool %}&ssl_verify_cert=true{% if senlin_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ senlin_galera_ssl_ca_cert }}{% endif %}{% endif %}
connection = mysql+pymysql://{{ senlin_galera_user }}:{{ senlin_galera_password }}@{{ senlin_galera_address }}/{{ senlin_galera_database }}?charset=utf8{% if senlin_galera_use_ssl | bool %}&ssl_verify_cert=true{% if senlin_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ senlin_galera_ssl_ca_cert }}{% endif %}{% endif +%}
max_overflow = {{ senlin_db_max_overflow }}
max_pool_size = {{ senlin_db_max_pool_size }}
pool_timeout = {{ senlin_db_pool_timeout }}
connection_recycle_time = {{ senlin_db_connection_recycle_time }}
[senlin_api]
bind_port = {{ senlin_service_port }}