From b230858fb494fc4773dcfa3ffa1bcf59d4171c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Gillot-Lamure?= Date: Tue, 23 May 2023 23:27:52 +0200 Subject: [PATCH] loadbalancer: remove support for haproxy_processes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ansible/roles/loadbalancer/defaults/main.yml | 4 +--- .../loadbalancer/templates/haproxy/haproxy_main.cfg.j2 | 8 +------- .../notes/haproxy-drop-processes-f6951f7b995e0694.yaml | 7 +++++++ 3 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 releasenotes/notes/haproxy-drop-processes-f6951f7b995e0694.yaml diff --git a/ansible/roles/loadbalancer/defaults/main.yml b/ansible/roles/loadbalancer/defaults/main.yml index 7db023e017..bb38946a74 100644 --- a/ansible/roles/loadbalancer/defaults/main.yml +++ b/ansible/roles/loadbalancer/defaults/main.yml @@ -52,9 +52,7 @@ 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" +haproxy_thread_cpu_map: "no" # Matches the mariadb 10000 max connections limit haproxy_defaults_max_connections: 10000 diff --git a/ansible/roles/loadbalancer/templates/haproxy/haproxy_main.cfg.j2 b/ansible/roles/loadbalancer/templates/haproxy/haproxy_main.cfg.j2 index 40d571bf93..0e572333b9 100644 --- a/ansible/roles/loadbalancer/templates/haproxy/haproxy_main.cfg.j2 +++ b/ansible/roles/loadbalancer/templates/haproxy/haproxy_main.cfg.j2 @@ -6,14 +6,8 @@ global daemon 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 }} - {% endfor %} - {% endif %} - {% if (haproxy_threads | int > 1) and (haproxy_process_cpu_map | bool) %} + {% 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 %} diff --git a/releasenotes/notes/haproxy-drop-processes-f6951f7b995e0694.yaml b/releasenotes/notes/haproxy-drop-processes-f6951f7b995e0694.yaml new file mode 100644 index 0000000000..9b5269dde6 --- /dev/null +++ b/releasenotes/notes/haproxy-drop-processes-f6951f7b995e0694.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + Configuring HAProxy nbproc setting via ``haproxy_processes`` and + ``haproxy_process_cpu_map`` variables has been dropped since + threads are the recommended way to scale CPU performance since 1.8. + Please use ``haproxy_threads`` and ``haproxy_thread_cpu_map`` instead.