diff --git a/src/haproxy.c b/src/haproxy.c index 1060fbc05..3f0e097bf 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -210,7 +210,6 @@ struct global global = { #endif /* by default allow clients which use a privileged port for TCP only */ .clt_privileged_ports = HA_PROTO_TCP, - .maxthrpertgroup = DEF_MAX_THREADS_PER_GROUP, /* others NULL OK */ }; diff --git a/src/thread.c b/src/thread.c index bb733a602..94b7b8dd7 100644 --- a/src/thread.c +++ b/src/thread.c @@ -1682,8 +1682,17 @@ void thread_detect_count(void) if (global.nbtgroups) { grp_min = grp_max = global.nbtgroups; /* ignore max-threads-per-group if thread-groups is configured */ + if (global.maxthrpertgroup) + ha_notice("max-threads-per-group is used to automatically calculate the optimal number of thread groups. It is ignored when thread-groups is set.\n"); global.maxthrpertgroup = MAX_THREADS_PER_GROUP; } + else { + /* set the default max-threads-per-group to calculate the + * optimal number of groups. + */ + if (!global.maxthrpertgroup) + global.maxthrpertgroup = DEF_MAX_THREADS_PER_GROUP; + } #if defined(USE_THREAD) /* Adjust to boot settings if not forced */