MINOR: listener: refine the default MAX_ACCEPT from 64 to 4
authorWilly Tarreau <w@1wt.eu>
Fri, 19 Feb 2021 14:50:27 +0000 (15:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 10 Mar 2021 14:11:01 +0000 (15:11 +0100)
commit8fa7f228a33881992ec27d315d7cd6544446c273
treecb53886b6044b7314c0f590a7eca1d632588a813
parent6c3d77629881f40e22d7dab35327c13ed41bd5c0
MINOR: listener: refine the default MAX_ACCEPT from 64 to 4

The maximum number of connections accepted at once by a thread for a single
listener used to default to 64 divided by the number of processes but the
tasklet-based model is much more scalable and benefits from smaller values.
Experimentation has shown that 4 gives the highest accept rate for all
thread values, and that 3 and 5 come very close, as shown below (HTTP/1
connections forwarded per second at multi-accept 4 and 64):

 ac\thr|    1     2    4     8     16
 ------+------------------------------
      4|   80k  106k  168k  270k  336k
     64|   63k   89k  145k  230k  274k

Some tests were also conducted on SSL and absolutely no change was observed.

The value was placed into a define because it used to be spread all over the
code.

It might be useful at some point to backport this to 2.3 and 2.2 to help
those who observed some performance regressions from 1.6.

(cherry picked from commit 66161326fd120652557d419810b1323405d7859d)
Signed-off-by: Willy Tarreau <w@1wt.eu>
doc/configuration.txt
include/haproxy/defaults.h
src/cfgparse.c
src/listener.c
src/log.c