From 3f20085617362cd1fd07da6058706019e5f8c3da Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 14 Mar 2019 19:13:17 +0100 Subject: [PATCH] BUG/MEDIUM: init/threads: consider epoll_fd/pipes for automatic maxconn calculation This is the equivalent of the previous patch for the automatic maxconn calculation. This doesn't need any backport. --- src/haproxy.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/haproxy.c b/src/haproxy.c index b7979ea4eb..28c72a58ae 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -1478,6 +1478,12 @@ static int compute_ideal_maxconn() /* subtract listeners and checks */ remain -= global.maxsock; + /* one epoll_fd/kqueue_fd per thread */ + remain -= global.nbthread; + + /* one wake-up pipe (2 fd) per thread */ + remain -= 2 * global.nbthread; + /* Fixed pipes values : we only subtract them if they're not larger * than the remaining FDs because pipes are optional. */ -- 2.47.3