]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: init: make the maxpipe computation more accurate
authorWilly Tarreau <w@1wt.eu>
Fri, 1 Mar 2019 13:19:31 +0000 (14:19 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 Mar 2019 14:53:14 +0000 (15:53 +0100)
commit5a023f0d7aa7686f29d399ef12cd94f2ea33b503
tree15a28ce2f1b5d0a35fff61d5be759a927e08d1b7
parent8dca19549ab3b30342b92b56b2c766a6a4ec8d0e
MINOR: init: make the maxpipe computation more accurate

The default number of pipes is adjusted based on the sum of frontends
and backends maxconn/fullconn settings. Now that it is possible to have
a null maxconn on a frontend to indicate "unlimited" with commit
c8d5b95e6 ("MEDIUM: config: don't enforce a low frontend maxconn value
anymore"), the sum of maxconn may remain low and limited to the only
frontends/backends where this limit is set.

This patch considers this new unlimited case when doing the check, and
automatically switches to the default value which is maxconn/4 in this
case. All the calculation was moved to a distinct function for ease of
use. This function also supports returning unlimited (-1) when the
value depends on global.maxconn and this latter is not yet set.
src/haproxy.c