[OPTIM] introduce global parameter "tune.maxaccept"
This new parameter makes it possible to override the default
number of consecutive incoming connections which can be
accepted on a socket. By default it is not limited on single
process mode, and limited to 8 in multi-process mode.
diff --git a/src/haproxy.c b/src/haproxy.c
index fd7c96e..f4f7b17 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -569,6 +569,13 @@
if (global.tune.maxpollevents <= 0)
global.tune.maxpollevents = MAX_POLL_EVENTS;
+ if (global.tune.maxaccept <= 0) {
+ if (global.nbproc > 1)
+ global.tune.maxaccept = 8; /* leave some conns to other processes */
+ else
+ global.tune.maxaccept = -1; /* accept all incoming conns */
+ }
+
if (arg_mode & (MODE_DEBUG | MODE_FOREGROUND)) {
/* command line debug mode inhibits configuration mode */
global.mode &= ~(MODE_DAEMON | MODE_QUIET);