loadbalancer: support cpu-map for threads

The directive used has the same semantic as what is done above for nbproc > 1:
it binds each thread to a CPU. It is simpler and does not require a loop because
it uses the auto: syntax available in HAProxy 2.4.

Change-Id: I1ce124b678140f5f4737df557683bb67bc7cfc66
This commit is contained in:
Léo Gillot-Lamure 2023-05-18 19:23:56 +02:00 committed by Michal Nasiadka
parent e043828601
commit 789ac7388c

View File

@ -13,6 +13,9 @@ global
cpu-map {{ cpu_idx + 1 }} {{ cpu_idx }} cpu-map {{ cpu_idx + 1 }} {{ cpu_idx }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% if (haproxy_threads | int > 1) and (haproxy_process_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 %} 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 %} {% if kolla_enable_tls_external | bool or kolla_enable_tls_internal | bool %}