net/haproxy: add new "shards" option, refs #3026

This commit is contained in:
Frank Wall
2023-01-05 01:12:39 +01:00
parent 57f89c6161
commit f9e325e882
4 changed files with 19 additions and 1 deletions
+2 -1
View File
@@ -9,7 +9,8 @@ Plugin Changelog
4.0
Added:
* add new option "Gradual connection close time" (close-spread-time) (#3026)
* add new service option "Gradual connection close time" (close-spread-time) (#3026)
* add new frontend option "shards" (#3026)
Changed:
* upgrade to HAProxy 2.6 release series (#3026)
@@ -297,6 +297,13 @@
<hint>Choose CPU affinity rules.</hint>
<advanced>true</advanced>
</field>
<field>
<id>frontend.tuning_shards</id>
<label>Shards</label>
<type>text</type>
<help><![CDATA[This option automatically creates the specified number of listeners for every IP:port combination and evenly distributes them among available threads. This can sometimes be useful when using very large thread counts where the in-kernel locking on a single socket starts to cause a significant overhead.]]></help>
<advanced>true</advanced>
</field>
<field>
<label>Logging Options</label>
<type>header</type>
@@ -655,6 +655,12 @@
<Multiple>Y</Multiple>
<Required>N</Required>
</linkedCpuAffinityRules>
<tuning_shards type="IntegerField">
<MinimumValue>2</MinimumValue>
<MaximumValue>1000</MaximumValue>
<ValidationMessage>Please specify a value between 2 and 1000.</ValidationMessage>
<Required>N</Required>
</tuning_shards>
<logging_dontLogNull type="BooleanField">
<default>0</default>
<Required>Y</Required>
@@ -1383,6 +1383,10 @@ frontend {{frontend.name}}
{% endif %}
{% endfor %}
{% endif %}
{# # shards / multiple listeners on the same IP:port #}
{% if frontend.tuning_shards|default('') != '' %}
{% do adv_options.append('shards ' ~ frontend.tuning_shards) %}
{% endif %}
{# # bind/listen configuration #}
{% if frontend.bind|default("") != "" %}
{% for bind in frontend.bind.split(",") %}