diff --git a/doc/configuration.txt b/doc/configuration.txt index eb3492711..18ceefdf9 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -251,10 +251,10 @@ tune.maxaccept Sets the maximum number of consecutive accepts that a process may perform on a single wake up. High values give higher priority to high connection rates, while lower values give higher priority to already established connections. - This value is unlimited by default in single process mode. However, in + This value is limited to 100 by default in single process mode. However, in multi-process mode (nbproc > 1), it defaults to 8 so that when one process wakes up, it does not take all incoming connections for itself and leaves a - part of them to other processes. Setting this value to zero or less disables + part of them to other processes. Setting this value to -1 completely disables the limitation. It should normally not be needed to tweak this value. tune.maxpollevents diff --git a/src/haproxy.c b/src/haproxy.c index cc6864ea4..d5d61251b 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -585,11 +585,11 @@ void init(int argc, char **argv) if (global.tune.maxpollevents <= 0) global.tune.maxpollevents = MAX_POLL_EVENTS; - if (global.tune.maxaccept <= 0) { + 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 */ + global.tune.maxaccept = 100; /* accept many incoming conns at once */ } if (arg_mode & (MODE_DEBUG | MODE_FOREGROUND)) {