b230858fb4
Threads are the recommended way to scale CPU performance since HAProxy 1.8. Official documentation says: « While "nbproc" historically used to be the only way to use multiple processors, it also involved a number of shortcomings related to the lack of synchronization between processes (health-checks, peers, stick-tables, stats, ...) which do not affect threads. As such, any modern configuration is strongly encouraged to migrate away from "nbproc" to "nbthread". ». Change-Id: I6f2e9d74e68703c8e0827e495945a75f020e1561
52 lines
1.8 KiB
Django/Jinja
52 lines
1.8 KiB
Django/Jinja
#jinja2: lstrip_blocks: True
|
|
global
|
|
chroot /var/lib/haproxy
|
|
user haproxy
|
|
group haproxy
|
|
daemon
|
|
log {{ syslog_server }}:{{ syslog_udp_port }} {{ syslog_haproxy_facility }}
|
|
maxconn {{ haproxy_max_connections }}
|
|
nbthread {{ haproxy_threads }}
|
|
{% if (haproxy_threads | int > 1) and (haproxy_thread_cpu_map | bool) %}
|
|
cpu-map auto:1/all 0-63
|
|
{% endif %}
|
|
stats socket /var/lib/kolla/haproxy/haproxy.sock group kolla mode 660{% if haproxy_socket_level_admin | bool %} level admin{% endif %}
|
|
|
|
{% if kolla_enable_tls_external | bool or kolla_enable_tls_internal | bool %}
|
|
ssl-default-bind-ciphers DEFAULT:!MEDIUM:!3DES
|
|
ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
|
|
tune.ssl.default-dh-param 4096
|
|
ca-base {{ haproxy_backend_cacert_dir }}
|
|
{% endif %}
|
|
|
|
defaults
|
|
log global
|
|
option redispatch
|
|
retries 3
|
|
timeout http-request {{ haproxy_http_request_timeout }}
|
|
timeout http-keep-alive {{ haproxy_http_keep_alive_timeout }}
|
|
timeout queue {{ haproxy_queue_timeout }}
|
|
timeout connect {{ haproxy_connect_timeout }}
|
|
timeout client {{ haproxy_client_timeout }}
|
|
timeout server {{ haproxy_server_timeout }}
|
|
timeout check {{ haproxy_check_timeout }}
|
|
balance {{ haproxy_defaults_balance }}
|
|
maxconn {{ haproxy_defaults_max_connections }}
|
|
|
|
listen stats
|
|
bind {{ api_interface_address }}:{{ haproxy_stats_port }}
|
|
mode http
|
|
stats enable
|
|
stats uri /
|
|
stats refresh 15s
|
|
stats realm Haproxy\ Stats
|
|
stats auth {{ haproxy_user }}:{{ haproxy_password }}
|
|
|
|
frontend status
|
|
bind {{ api_interface_address }}:{{ haproxy_monitor_port }}
|
|
{% if api_interface_address != kolla_internal_vip_address %}
|
|
bind {{ kolla_internal_vip_address }}:{{ haproxy_monitor_port }}
|
|
{% endif %}
|
|
mode http
|
|
monitor-uri /
|