Files
openstack-ansible-haproxy_s…/templates/haproxy.cfg.j2
Andrey c477565acb Added Haproxy global tunables
Max number of connection may be set up, as well as major tunables
may be added as the variables.

Change-Id: I5b333b79680d81b030810a7e94e3cc4bfe724649
2017-03-15 18:06:16 -05:00

52 lines
1.8 KiB
Django/Jinja

# {{ ansible_managed }}
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
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.http.maxaccept{{ haproxy_tuning_params.http_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_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
retries 3
timeout client 50s
timeout connect 10s
timeout http-request {{ haproxy_http_request_timeout }}
timeout server 50s
maxconn 4096
{% if haproxy_stats_enabled | bool %}
listen stats
bind {{ haproxy_stats_bind_address }}:{{ haproxy_stats_port }}
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 60s
{% endif %}