openstack-ansible-galera_se.../templates/systemd.limits.conf.j2
Kyle L. Henderson 49a010176f Fix galera max connections calculation
The max connection calculation uses the number of vcpus reported by ansible
however it's using the wrong value in one portion of the calculation. The
result is that the calculation returns 0 rather than the intended 200 when
there are both x86 and POWER controllers.

Change-Id: I48314a3b701da4df6aaa0c163b14da36a1e70b7f
Closes-Bug: #1647106
2016-12-05 15:26:39 +00:00

14 lines
545 B
Django/Jinja

# {{ ansible_managed }}
{%- set all_calculated_max_connections = [] %}
{%- for galera_node in galera_cluster_members %}
{%- set vcpus = hostvars[galera_node]['ansible_processor_vcpus'] %}
{%- set _ = all_calculated_max_connections.append((vcpus | int > 0) | ternary (vcpus, 2) * 100) %}
{%- endfor %}
{%- set calculated_min_connections = all_calculated_max_connections | min %}
{%- set calculated_max_connections = galera_max_connections | default(calculated_min_connections) %}
[Service]
LimitNOFILE={{ calculated_max_connections }}