diff --git a/haproxy/defaults/main.yml b/haproxy/defaults/main.yml index 1ba41ab8..d837ca20 100644 --- a/haproxy/defaults/main.yml +++ b/haproxy/defaults/main.yml @@ -25,3 +25,5 @@ haproxy_nagios_check_c: 90 haproxy_check_interval: 3s haproxy_backend_maxconn: 2048 +haproxy_sysctl_conntrack_max: 131072 + diff --git a/haproxy/tasks/haproxy-service.yml b/haproxy/tasks/haproxy-service.yml index 08471182..d211599b 100644 --- a/haproxy/tasks/haproxy-service.yml +++ b/haproxy/tasks/haproxy-service.yml @@ -45,10 +45,18 @@ with_items: - net.ipv4.ip_nonlocal_bind when: haproxy_k_bind_non_local_ip + tags: [ 'haproxy', 'haproxy_sysctl' ] - name: Disable kernel binding non local IP addresses sysctl: name={{ item }} value=0 reload=yes state=present with_items: - net.ipv4.ip_nonlocal_bind when: not haproxy_k_bind_non_local_ip + tags: [ 'haproxy', 'haproxy_sysctl' ] + +- name: Increase the connection tracking table capacity + sysctl: name={{ item }} value={{ haproxy_sysctl_conntrack_max }} reload=yes state=present + with_items: + - net.nf_conntrack_max + tags: [ 'haproxy', 'haproxy_sysctl' ]