diff --git a/src/haproxy.c b/src/haproxy.c index 317acebbb..b7979ea4e 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2162,6 +2162,9 @@ static void init(int argc, char **argv) global.hardmaxconn = global.maxconn; /* keep this max value */ global.maxsock += global.maxconn * 2; /* each connection needs two sockets */ global.maxsock += global.maxpipes * 2; /* each pipe needs two FDs */ + global.maxsock += global.nbthread; /* one epoll_fd/kqueue_fd per thread */ + global.maxsock += 2 * global.nbthread; /* one wake-up pipe (2 fd) per thread */ + /* compute fd used by async engines */ if (global.ssl_used_async_engines) { int sides = !!global.ssl_used_frontend + !!global.ssl_used_backend;