Since it's easy to get caught by some parameters being ignored, let's
detect when mtpg was explicitly set and report a notice if it is ignored
due to thread-groups being set. For this we need to avoid presetting
the value in the global section and only set it when entering function
thread_detect_count(), which is OK since the value cannot be used before.
#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 */
};
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 */