diff --git a/ansible/roles/loadbalancer/defaults/main.yml b/ansible/roles/loadbalancer/defaults/main.yml index ddc8c604debba8a08a25f89d07dffd0c0b9f0c06..7db023e017c1c9b7f0f39c593f2e45b30c0e40c2 100644 --- a/ansible/roles/loadbalancer/defaults/main.yml +++ b/ansible/roles/loadbalancer/defaults/main.yml @@ -51,6 +51,8 @@ keepalived_traffic_mode: "multicast" # Extended global configuration, optimization options. haproxy_max_connections: 40000 +haproxy_threads: 1 +# More than 1 process is deprecated by HAProxy, prefer haproxy_threads haproxy_processes: 1 haproxy_process_cpu_map: "no" # Matches the mariadb 10000 max connections limit diff --git a/ansible/roles/loadbalancer/templates/haproxy/haproxy_main.cfg.j2 b/ansible/roles/loadbalancer/templates/haproxy/haproxy_main.cfg.j2 index 5e4ad2c673919feed0403494c11b21592da4cbe4..39a6ceed516a88f1194b35dc0a06333064073d90 100644 --- a/ansible/roles/loadbalancer/templates/haproxy/haproxy_main.cfg.j2 +++ b/ansible/roles/loadbalancer/templates/haproxy/haproxy_main.cfg.j2 @@ -7,6 +7,7 @@ global log {{ syslog_server }}:{{ syslog_udp_port }} {{ syslog_haproxy_facility }} maxconn {{ haproxy_max_connections }} nbproc {{ haproxy_processes }} + nbthread {{ haproxy_threads }} {% if (haproxy_processes | int > 1) and (haproxy_process_cpu_map | bool) %} {% for cpu_idx in range(0, haproxy_processes) %} cpu-map {{ cpu_idx + 1 }} {{ cpu_idx }} diff --git a/releasenotes/notes/haproxy-nbthread-7680f1be54eeb365.yaml b/releasenotes/notes/haproxy-nbthread-7680f1be54eeb365.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c71dd7e2e2c4f7ff1299574e7ae88ca9fcfebe81 --- /dev/null +++ b/releasenotes/notes/haproxy-nbthread-7680f1be54eeb365.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + HAProxy supports setting nbthread via variable haproxy_threads. + Threads are recommended instead of processes since HAProxy 1.8. + They cannot be used both at the same time.