]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: init: move the maxsock calculation code to compute_ideal_maxsock()
authorWilly Tarreau <w@1wt.eu>
Tue, 10 Mar 2020 16:08:53 +0000 (17:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 10 Mar 2020 17:08:11 +0000 (18:08 +0100)
commita409f30d09a5ec5ec2d0b6e87a9ca5d0fd36935b
treebed721bc37243cec0483edcface8c247f3b3e4b6
parent1d117e3dcdae6b59b19e0d875530b5d1f6b24c03
MINOR: init: move the maxsock calculation code to compute_ideal_maxsock()

The maxsock value is currently derived from global.maxconn and a few other
settings, some of which also depend on global.maxconn. This makes it
difficult to check if a limit is already too high or not during the maxconn
automatic sizing.

Let's move this code into a new function, compute_ideal_maxsock() which now
takes a maxconn in argument. It performs the same operations and returns
the maxsock value if global.maxconn were to be set to that value. It now
replaces the previous code to compute maxsock.
src/haproxy.c