]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: init: fix fd_hard_limit default in compute_ideal_maxconn
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Fri, 5 Jul 2024 18:42:09 +0000 (20:42 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 8 Jul 2024 09:26:16 +0000 (11:26 +0200)
commit16a5fac4bba1cb2bb6cf686066256aa141515feb
tree9954af35313986186772b7eab9332b215803e5e0
parent3d4baa3c7b805bb0c01937a86a5ecd69afac7df6
BUG/MEDIUM: init: fix fd_hard_limit default in compute_ideal_maxconn

This commit fixes 41275a691 ("MEDIUM: init: set default for fd_hard_limit via
DEFAULT_MAXFD").

fd_hard_limit is taken in account implicitly via 'ideal_maxconn' value in
all maxconn adjustements, when global.rlimit_memmax is set:

MIN(global.maxconn, capped by global.rlimit_memmax, ideal_maxconn);

It also caps provided global.rlimit_nofile, if it couldn't be set as a current
process fd limit (see more details in the main() code).

So, lets set the default value for fd_hard_limit only, when there is no any
other haproxy-specific limit provided, i.e. rlimit_memmax, maxconn,
rlimit_nofile. Otherwise we may break users configs.

Please, note, that in master-worker mode, master does not need the
DEFAULT_MAXFD (1048576) as well, as we explicitly limit its maxconn to 100.

Must be backported in all stable versions until v2.6.0, including v2.6.0,
like the commit above.
src/haproxy.c