
When HAProxy is run in multi-process mode, the single stats page shows metrics for one of the processes at a time, with a random selection made on page reload. Whilst a more complete solution may be to enable a stats page for each process, this is a little cumbersome. This addition allows the stats page to be pinned to one process, providing a partial snapshot of the state of the instance. Change-Id: Id9314e5b267aafeaf34c82874eb8bfe0713dfac3
59 lines
2.2 KiB
Django/Jinja
59 lines
2.2 KiB
Django/Jinja
# {{ ansible_managed }}
|
|
|
|
global
|
|
log /dev/log local0
|
|
chroot /var/lib/haproxy
|
|
user haproxy
|
|
group haproxy
|
|
daemon
|
|
maxconn {{ haproxy_maxconn }}
|
|
{% if haproxy_tuning_params is defined %}
|
|
nbproc {{ haproxy_tuning_params.nbproc | default('1') }}
|
|
tune.bufsize {{ haproxy_tuning_params.bufsize | default('384000') }}
|
|
tune.chksize {{ haproxy_tuning_params.chksize | default('16384') }}
|
|
tune.comp.maxlevel {{ haproxy_tuning_params.comp_maxlevel | default('1') }}
|
|
tune.http.maxhdr {{ haproxy_tuning_params.http_maxhdr | default('101') }}
|
|
tune.maxaccept {{ haproxy_tuning_params.maxaccept | default('64') }}
|
|
tune.ssl.cachesize {{ haproxy_tuning_params.ssl_cachesize | default('20000') }}
|
|
tune.ssl.lifetime {{ haproxy_tuning_params.ssl_lifetime | default('300') }}
|
|
{% endif %}
|
|
stats socket /var/run/haproxy.stat level admin mode 600
|
|
{% if haproxy_stats_process is defined %}
|
|
stats bind-process {{ haproxy_stats_process }}
|
|
{% endif %}
|
|
{% if haproxy_ssl | bool %}
|
|
ssl-default-bind-options {{ haproxy_ssl_bind_options }}
|
|
tune.ssl.default-dh-param {{haproxy_ssl_dh_param}}
|
|
{% endif %}
|
|
|
|
defaults
|
|
log global
|
|
option dontlognull
|
|
option redispatch
|
|
option {{ haproxy_keepalive_mode }}
|
|
retries {{ haproxy_retries }}
|
|
timeout client {{ haproxy_client_timeout }}
|
|
timeout connect {{ haproxy_connect_timeout }}
|
|
timeout http-request {{ haproxy_http_request_timeout }}
|
|
timeout server {{ haproxy_server_timeout }}
|
|
maxconn {{ haproxy_maxconn }}
|
|
|
|
{% if haproxy_stats_enabled | bool %}
|
|
listen stats
|
|
bind {{ haproxy_stats_bind_address }}:{{ haproxy_stats_port }} {% if haproxy_ssl | bool %}ssl crt {{ haproxy_ssl_pem }} ciphers {{ haproxy_ssl_cipher_suite }}{% endif %}
|
|
|
|
{% if haproxy_stats_process is defined %}
|
|
bind-process {{ haproxy_stats_process }}
|
|
{% endif %}
|
|
mode http
|
|
stats enable
|
|
stats hide-version
|
|
stats realm Haproxy\ Statistics
|
|
stats uri /
|
|
stats show-node
|
|
stats show-legends
|
|
stats auth {{ haproxy_username }}:{{ haproxy_stats_password }}
|
|
stats admin if TRUE
|
|
stats refresh {{ haproxy_stats_refresh_interval }}s
|
|
{% endif %}
|