]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: config: automatically preset MAX_THREADS based on MAX_TGROUPS
authorWilly Tarreau <w@1wt.eu>
Sat, 6 Aug 2022 14:37:27 +0000 (16:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 6 Aug 2022 14:51:20 +0000 (16:51 +0200)
commit693688e734b98d6e661b7effe969c8e9a2f6830c
tree960126833bcf9f3062d3e4f973c4adcadfe96176
parentc80bdb2da682822c5a41326bf1847995c8630c78
MINOR: config: automatically preset MAX_THREADS based on MAX_TGROUPS

MAX_THREADS was not changed when setting MAX_TGROUPS, which still limits
some possibilities. Let's preset it to 4 * LONGBITS when MAX_TGROUPS is
larger than 1, or LONGBITS when it's set to 1. This means that the new
default value is 256 threads.

The rationale behind this is that the main use of thread groups is
mostly to address NUMA issues and that we don't necessarily need large
thread counts when using many groups, and 256 threads is already plenty
even on quite large systems.

For now it's important not to go too far because some internal structs
are arrays of MAX_THREADS entries, for example accept_queue_ring, which
is around 8kB per thread. Such structures will need to become dynamic
before defaulting to large thread counts (at 4096 threads max the
accept queues would require 32 MB RAM alone).
include/haproxy/defaults.h