]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: thread: start to detect thread groups and threads min/max
authorWilly Tarreau <w@1wt.eu>
Tue, 18 Jul 2023 12:04:10 +0000 (14:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Mar 2025 17:30:30 +0000 (18:30 +0100)
commit1af4942c95ce261a53db83d54565fa1d495ad424
treeecfb14fe85286de81cab8b670ca7d6a6c9d800c0
parent68069e4b27a550a22d140ce2f2389c090f722d44
MEDIUM: thread: start to detect thread groups and threads min/max

By mutually refining the thread count and group count, we can try
to detect the most suitable setup for the current machine. Taskset
is implicitly handled correctly. tgroups automatically adapt to the
configured number of threads. cpu-map manages to limit tgroups to
the smallest supported value.

The thread-limit is enforced. Just like in cfgparse, if the thread
count was forced to a higher value, it's reduced and a warning is
emitted. But if it was not set, the thr_max value is bound to this
limit so that further calculations respect it.

We continue to default to the max number of available threads and 1
tgroup by default, with the limit. This normally allows to get rid
of that test in check_config_validity().
include/haproxy/thread.h
src/haproxy.c
src/thread.c