瀏覽代碼

Merge "Variable to set HTTP keepalive mode"

changes/03/645903/1
Zuul 7 月之前
父節點
當前提交
ca51879876
共有 3 個文件被更改,包括 8 次插入1 次删除
  1. 4
    0
      defaults/main.yml
  2. 1
    0
      templates/haproxy.cfg.j2
  3. 3
    1
      templates/service.j2

+ 4
- 0
defaults/main.yml 查看文件

@@ -104,6 +104,10 @@ haproxy_connect_timeout: "10s"
haproxy_http_request_timeout: "5s"
# Set the maximum inactivity time on the server side
haproxy_server_timeout: "50s"
# Set the HTTP keepalive mode to use
# Disable persistent connections by default because they can cause issues when the server side closes the connection
# at the same time a request is sent.
haproxy_keepalive_mode: 'forceclose'


## haproxy tuning params

+ 1
- 0
templates/haproxy.cfg.j2 查看文件

@@ -28,6 +28,7 @@ defaults
log global
option dontlognull
option redispatch
option {{ haproxy_keepalive_mode }}
retries {{ haproxy_retries }}
timeout client {{ haproxy_client_timeout }}
timeout connect {{ haproxy_connect_timeout }}

+ 3
- 1
templates/service.j2 查看文件

@@ -44,7 +44,9 @@ frontend {{ item.service.haproxy_service_name }}-front-{{ loop.index }}
{% if request_option == "http" %}
option httplog
option forwardfor except 127.0.0.0/8
option http-server-close
{% if item.service.haproxy_http_keepalive_mode is defined %}
option {{ item.service.haproxy_http_keepalive_mode }}
{% endif %}
{% elif request_option == "tcp" %}
option tcplog
{% endif %}

Loading…
取消
儲存