]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM/MINOR: config: Optimize fullconn automatic computation loading configuration
authorEmeric Brun <ebrun@haproxy.com>
Thu, 12 Jan 2017 10:21:28 +0000 (11:21 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Jan 2017 16:36:09 +0000 (17:36 +0100)
commit3f78357066288c386709fc9439d56b5d36fe3f35
treecf1a395c5d4d90f7d92c02778bc94f25d9d0b154
parent3eb5b3fdd314a086cfcc04e3160dbc82e03d834a
OPTIM/MINOR: config: Optimize fullconn automatic computation loading configuration

The previous version used an O(number of proxies)^2 algo to get the sum of
the number of maxconns of frontends which reference a backend at least once.

This new version adds the frontend's maxconn number to the backend's
struct proxy member 'tot_fe_maxconn' when the backend name is resolved
for switching rules or default_backend statment.  At the end, the final
backend's fullconn is computed looping only one time for all on proxies O(n).

The load of a configuration using a large amount of backends (10 thousands)
without configured fullconn was reduced from several minutes to few seconds.
include/types/proxy.h
src/cfgparse.c