From 46f9ad3a96d9a30a6741781cb0b47550cdb23e4f Mon Sep 17 00:00:00 2001 From: Scott Solkhon Date: Tue, 13 Aug 2019 15:45:57 +0000 Subject: [PATCH] HAProxy backend connection limits The default connection limits for backends is 2000 however, mariadb defaults to a max of 10000 conections, therefore changing this limit to match the mariadb limit. 'haproxy_max_connections' also needs to be bumped for this to work. Change-Id: I5ded328485855f3f3d4390282040b0d89d08d997 --- ansible/roles/haproxy/defaults/main.yml | 4 +++- ansible/roles/haproxy/templates/haproxy_main.cfg.j2 | 1 + ...ncrease-haproxy-max-connections-df6aff5c82fdef24.yaml | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/increase-haproxy-max-connections-df6aff5c82fdef24.yaml diff --git a/ansible/roles/haproxy/defaults/main.yml b/ansible/roles/haproxy/defaults/main.yml index 970f2c1d41..3a7e0a333b 100644 --- a/ansible/roles/haproxy/defaults/main.yml +++ b/ansible/roles/haproxy/defaults/main.yml @@ -45,9 +45,11 @@ syslog_haproxy_facility: "local1" keepalived_traffic_mode: "multicast" # Extended global configuration, optimization options. -haproxy_max_connections: 4000 +haproxy_max_connections: 40000 haproxy_processes: 1 haproxy_process_cpu_map: "no" +# Matches the mariadb 10000 max connections limit +haproxy_defaults_max_connections: 10000 haproxy_dimensions: "{{ default_container_dimensions }}" keepalived_dimensions: "{{ default_container_dimensions }}" diff --git a/ansible/roles/haproxy/templates/haproxy_main.cfg.j2 b/ansible/roles/haproxy/templates/haproxy_main.cfg.j2 index 34f2c453a6..cdc242986f 100644 --- a/ansible/roles/haproxy/templates/haproxy_main.cfg.j2 +++ b/ansible/roles/haproxy/templates/haproxy_main.cfg.j2 @@ -30,6 +30,7 @@ defaults timeout server {{ haproxy_server_timeout }} timeout check {{ haproxy_check_timeout }} balance {{ haproxy_defaults_balance }} + maxconn {{ haproxy_defaults_max_connections }} listen stats bind {{ api_interface_address }}:{{ haproxy_stats_port }} diff --git a/releasenotes/notes/increase-haproxy-max-connections-df6aff5c82fdef24.yaml b/releasenotes/notes/increase-haproxy-max-connections-df6aff5c82fdef24.yaml new file mode 100644 index 0000000000..44f521991f --- /dev/null +++ b/releasenotes/notes/increase-haproxy-max-connections-df6aff5c82fdef24.yaml @@ -0,0 +1,9 @@ +--- +upgrade: + - | + The default connection limit for HAProxy backends is 2000 however, MariaDB + defaults to a max of 10000 conections. This has been changed to match the + MariaDB limit. + + 'haproxy_max_connections' has also been increased to 40000 to accommodate + this.