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: Ib258eeb4989236215d645b21ed25f9d35c3a2a0a
This commit is contained in:
parent
34b01f7c6d
commit
954c0a96d0
|
@ -126,9 +126,10 @@ zun_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | def
|
|||
zun_galera_address: "{{ galera_address | default('127.0.0.1') }}"
|
||||
zun_galera_user: zun
|
||||
zun_galera_database: zun
|
||||
zun_db_max_overflow: 10
|
||||
zun_db_max_pool_size: 120
|
||||
zun_db_pool_timeout: 30
|
||||
zun_db_max_overflow: "{{ openstack_db_max_overflow | default('50') }}"
|
||||
zun_db_max_pool_size: "{{ openstack_db_max_pool_size | default('5') }}"
|
||||
zun_db_pool_timeout: "{{ openstack_db_pool_timeout | default('30') }}"
|
||||
zun_db_connection_recycle_time: "{{ openstack_db_connection_recycle_time | default('600') }}"
|
||||
# Toggle whether zun connects via an encrypted connection
|
||||
zun_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
|
||||
# The path where to store the database server CA certificate
|
||||
|
|
|
@ -22,11 +22,11 @@ endpoint_type = {{ zun_service_endpoint_type }}
|
|||
|
||||
{% if group_names | intersect(zun_services.keys() | difference('zun-compute') | map('extract', zun_services, 'group') | list) | count > 0 %}
|
||||
[database]
|
||||
connection = mysql+pymysql://{{ zun_galera_user }}:{{ zun_galera_password }}@{{ zun_galera_address }}/{{ zun_galera_database }}?charset=utf8{% if zun_galera_use_ssl | bool %}&ssl_verify_cert=true{% if zun_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ zun_galera_ssl_ca_cert }}{% endif %}{% endif %}
|
||||
|
||||
max_pool_size = {{ zun_db_max_pool_size }}
|
||||
connection = mysql+pymysql://{{ zun_galera_user }}:{{ zun_galera_password }}@{{ zun_galera_address }}/{{ zun_galera_database }}?charset=utf8{% if zun_galera_use_ssl | bool %}&ssl_verify_cert=true{% if zun_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ zun_galera_ssl_ca_cert }}{% endif %}{% endif +%}
|
||||
max_overflow = {{ zun_db_max_overflow }}
|
||||
max_pool_size = {{ zun_db_max_pool_size }}
|
||||
pool_timeout = {{ zun_db_pool_timeout }}
|
||||
connection_recycle_time = {{ zun_db_connection_recycle_time }}
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue