mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-28 22:31:06 +01:00
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).