Commit 8bfb6de4 authored by Jérome Perrin's avatar Jérome Perrin

stack/erp5: modernize haproxy config

* expect a minimum connection_count of 4, using 1 (or 2) seems to cause
balancing issues (test_balancer had several errors).

* set a timeout server, a bit more than the timeout client, to prevent
this warning:

    [WARNING]  (26864) : config : missing timeouts for proxy 'family_default'.
       | While not properly invalid, you will certainly encounter various problems
       | with such a configuration. To fix this, please ensure that all following
       | timeouts are set to a non-zero value: 'client', 'connect', 'server'.

* update health check directive to what the examples from
https://www.haproxy.com/blog/how-to-enable-health-checks-in-haproxy/
parent 65756a1a
......@@ -94,7 +94,7 @@ md5sum = b0751d3d12cfcc8934cb1027190f5e5e
[template-haproxy-cfg]
filename = haproxy.cfg.in
md5sum = 1645ef8990ab2b50f91a4c02f0cf8882
md5sum = cd084f1d57ad2c75f8f588b2a0f3f79f
[template-rsyslogd-cfg]
filename = rsyslogd.cfg.in
......
......@@ -51,7 +51,7 @@
# None, # timeout (in seconds) int | None
# [ # backends
# '10.0.0.10:8001', # netloc str
# 1, # max_connection_count int
# 5, # connection_count int
# False, # is_web_dav bool
# ],
# ),
......@@ -63,7 +63,7 @@
# None, # timeout (in seconds) int | None
# [ # backends
# '10.0.0.10:8003', # netloc str
# 1, # max_connection_count int
# 10, # connection_count int
# False, # is_web_dav bool
# ],
# ),
......@@ -138,6 +138,7 @@ defaults
timeout connect 10s
timeout queue 60s
timeout client 305s
timeout server 306s
option http-server-close
......@@ -193,10 +194,11 @@ listen family_{{ name }}
{% for address, connection_count, webdav in backend_list -%}
{% if webdav %}{% do has_webdav.append(None) %}{% endif -%}
{% set server_name = name ~ '-' ~ loop.index0 %}
server {{ server_name }} {{ address }} cookie {{ server_name }} check inter 3s rise 1 fall 2 maxqueue 5 maxconn {{ connection_count }}
server {{ server_name }} {{ address }} cookie {{ server_name }} check inter 3s rise 1 fall 2 maxqueue 5 maxconn {% if connection_count > 4 %} {{ connection_count }} {% else %} 4 {% endif %}
{%- endfor -%}
{%- if not has_webdav and server_check_path %}
option httpchk GET {{ server_check_path }}
option httpchk
http-check send meth GET uri {{ server_check_path }}
{%- endif %}
{% endfor %}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment