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: I7804ec93d6ec82249f4d81ccec3ab02c4bc8a233
This commit is contained in:
Damian Dabrowski 2021-12-02 19:11:28 +01:00 committed by Dmitriy Rabotyagov
parent 1a7f8b2a57
commit 6353f2f747
3 changed files with 15 additions and 6 deletions

View File

@ -70,9 +70,11 @@ octavia_galera_user: octavia
octavia_galera_database: octavia
octavia_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
octavia_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('') }}"
octavia_db_max_overflow: 20
octavia_db_pool_size: 120
octavia_db_pool_timeout: 30
octavia_db_max_overflow: "{{ openstack_db_max_overflow | default('50') }}"
# TODO(damiandabrowski): Remove octavia_db_pool_size in Yoga release
octavia_db_max_pool_size: "{{ openstack_db_max_pool_size | default(octavia_db_pool_size | default('5')) }}"
octavia_db_pool_timeout: "{{ openstack_db_pool_timeout | default('30') }}"
octavia_db_connection_recycle_time: "{{ openstack_db_connection_recycle_time | default('600') }}"
octavia_galera_port: "{{ galera_port | default('3306') }}"
## Oslo Messaging

View File

@ -0,0 +1,7 @@
---
deprecations:
- |
For consistency reasons, ``octavia_db_pool_size`` was deprecated in favor of
``octavia_db_max_pool_size`` which is in a standardized format used in other
repositories.
``octavia_db_pool_size`` support it will be removed in Yoga release.

View File

@ -25,11 +25,11 @@ driver = {{ (octavia_ceilometer_enabled | bool) | ternary('messagingv2', 'noop')
transport_url = {{ octavia_oslomsg_notify_transport }}://{% for host in octavia_oslomsg_notify_servers.split(',') %}{{ octavia_oslomsg_notify_userid }}:{{ octavia_oslomsg_notify_password }}@{{ host }}:{{ octavia_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ octavia_oslomsg_notify_vhost }}{% if octavia_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ octavia_oslomsg_notify_ssl_version }}&ssl_ca_file={{ octavia_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
[database]
connection = mysql+pymysql://{{ octavia_galera_user }}:{{ octavia_container_mysql_password }}@{{ octavia_galera_address }}/{{ octavia_galera_database }}?charset=utf8{% if octavia_galera_use_ssl | bool %}&ssl_verify_cert=true{% if octavia_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ octavia_galera_ssl_ca_cert }}{% endif %}{% endif %}
connection = mysql+pymysql://{{ octavia_galera_user }}:{{ octavia_container_mysql_password }}@{{ octavia_galera_address }}/{{ octavia_galera_database }}?charset=utf8{% if octavia_galera_use_ssl | bool %}&ssl_verify_cert=true{% if octavia_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ octavia_galera_ssl_ca_cert }}{% endif %}{% endif +%}
max_overflow = {{ octavia_db_max_overflow }}
max_pool_size = {{ octavia_db_pool_size }}
max_pool_size = {{ octavia_db_max_pool_size }}
pool_timeout = {{ octavia_db_pool_timeout }}
connection_recycle_time = {{ octavia_db_connection_recycle_time }}
[health_manager]
bind_ip = 0.0.0.0