]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: threads: enable one thread per CPU by default
authorWilly Tarreau <w@1wt.eu>
Sat, 26 Jan 2019 13:27:06 +0000 (14:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 27 Feb 2019 13:51:50 +0000 (14:51 +0100)
commit149ab779cccb822fd93a7c59c3cf48aff35732f0
treecf4451ea2f4f89bbe081ac5aa9628c3a17667e9c
parent7ac908bf8c1402b18cc32a5c24cd13d3f86dcc19
MAJOR: threads: enable one thread per CPU by default

Threads have long matured by now, still for most users their usage is
not trivial. It's about time to enable them by default on platforms
where we know the number of CPUs bound. This patch does this, it counts
the number of CPUs the process is bound to upon startup, and enables as
many threads by default. Of course, "nbthread" still overrides this, but
if it's not set the default behaviour is to start one thread per CPU.

The default number of threads is reported in "haproxy -vv". Simply using
"taskset -c" is now enough to adjust this number of threads so that there
is no more need for playing with cpu-map. And thanks to the previous
patches on the listener, the vast majority of configurations will not
need to duplicate "bind" lines with the "process x/y" statement anymore
either, so a simple config will automatically adapt to the number of
processors available.
doc/configuration.txt
include/common/hathreads.h
src/cfgparse.c
src/haproxy.c
src/hathreads.c