From 79b39d585ac1941c296dcab930047ceb0da8fd52 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Tue, 24 Jan 2017 17:45:23 +0000 Subject: [PATCH] Set the proper amount of open files in systemd We used the amount of connections instead of the maximum number of open files for the systemd unit limit. The amount of connections are handled by mysql. Change-Id: Ib82cba87038ac2601b4ff268c6c889dbe2387228 Closes-Bug: #1659060 --- ...-amount-of-open-files-systemd-54af64659bf61518.yaml | 8 ++++++++ templates/systemd.limits.conf.j2 | 10 +--------- 2 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/fix-wrong-amount-of-open-files-systemd-54af64659bf61518.yaml diff --git a/releasenotes/notes/fix-wrong-amount-of-open-files-systemd-54af64659bf61518.yaml b/releasenotes/notes/fix-wrong-amount-of-open-files-systemd-54af64659bf61518.yaml new file mode 100644 index 00000000..c8a2a866 --- /dev/null +++ b/releasenotes/notes/fix-wrong-amount-of-open-files-systemd-54af64659bf61518.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - Systems using systemd (like Ubuntu Xenial) were + incorrectly limited to a low amount of open files. + This was causing issues when restarting galera. + A deployer can still define the maximum number + of open files with the variable + ``galera_file_limits`` (Defaults to 65536). diff --git a/templates/systemd.limits.conf.j2 b/templates/systemd.limits.conf.j2 index 310c8582..a5fefd3f 100644 --- a/templates/systemd.limits.conf.j2 +++ b/templates/systemd.limits.conf.j2 @@ -1,13 +1,5 @@ # {{ 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 }} +LimitNOFILE={{ galera_file_limits }}