]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: config: don't enforce a low frontend maxconn value anymore
authorWilly Tarreau <w@1wt.eu>
Wed, 27 Feb 2019 16:25:52 +0000 (17:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 28 Feb 2019 16:05:32 +0000 (17:05 +0100)
commitc8d5b95e6da3f6cc7f8fb725292dacc477afdb8c
treeadae8ebd1b3a81ecb2c3183e6558047da12f5b24
parentd89cc8bfc07702e4ce7ab818b4fc4483ef6e63bc
MEDIUM: config: don't enforce a low frontend maxconn value anymore

Historically the default frontend's maxconn used to be quite low (2000),
which was sufficient two decades ago but often proved to be a problem
when users had purposely set the global maxconn value but forgot to set
the frontend's.

There is no point in keeping this arbitrary limit for frontends : when
the global maxconn is lower, it's already too high and when the global
maxconn is much higher, it becomes a limiting factor which causes trouble
in production.

This commit allows the value to be set to zero, which becomes the new
default value, to mean it's not directly limited, or in fact it's set
to the global maxconn. Since this operation used to be performed before
computing a possibly automatic global maxconn based on memory limits,
the calculation of the maxconn value and its propagation to the backends'
fullconn has now moved to a dedicated function, proxy_adjust_all_maxconn(),
which is called once the global maxconn is stabilized.

This comes with two benefits :
  1) a configuration missing "maxconn" in the defaults section will not
     limit itself to a magically hardcoded value but will scale up to the
     global maxconn ;

  2) when the global maxconn is not set and memory limits are used instead,
     the frontends' maxconn automatically adapts, and the backends' fullconn
     as well.
doc/configuration.txt
include/proto/proxy.h
src/cfgparse.c
src/haproxy.c
src/proxy.c