
The '*' operator can do string concatenation or integer multiply. Ensure that we work on integers. See https://paste.opendev.org/show/810346/ Change-Id: Ia2c3785fcab4d70e29b8be8c29b8aa81ef6ec5a8
17 lines
790 B
Django/Jinja
17 lines
790 B
Django/Jinja
# {{ ansible_managed }}
|
|
|
|
{%- set all_calculated_max_connections = [] %}
|
|
{%- for galera_node in galera_cluster_members %}
|
|
{%- set vcpus = hostvars[galera_node]['ansible_facts']['processor_vcpus'] %}
|
|
{%- set _ = all_calculated_max_connections.append([[vcpus|default(2), 2] | max, galera_wsrep_slave_threads_max] | min | int * 100) %}
|
|
{%- endfor %}
|
|
{%- set calculated_min_connections = all_calculated_max_connections | min %}
|
|
{%- set calculated_max_connections = galera_max_connections | default(calculated_min_connections) %}
|
|
|
|
# How long to wait for successful mysql startup
|
|
# Startup can take a while if it requires a galera state transfer.
|
|
MYSQLD_STARTUP_TIMEOUT={{ galera_startup_timeout }}
|
|
|
|
ulimit -n {{ calculated_max_connections }}
|
|
ulimit -Hn {{ calculated_max_connections }}
|