diff --git a/doc/configuration.txt b/doc/configuration.txt index 8ba4ce897..e8e54a31d 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -2267,7 +2267,11 @@ thread-group [...] thread-groups This setting is only available when support for threads was built in. It makes HAProxy split its threads into independent groups. At the - moment, the limit is 1 and is also the default value. See also "nbthread". + moment, the default value is 1. Thread groups make it possible to reduce + sharing between threads to limit contention, at the expense of some extra + configuration efforts. It is also the only way to use more than 64 threads + since up to 64 threads per group may be configured. The maximum number of + groups is configured at compile time and defaults to 16. See also "nbthread". uid Changes the process's user ID to . It is recommended that the user ID diff --git a/include/haproxy/defaults.h b/include/haproxy/defaults.h index 21aae896d..6dc5167d8 100644 --- a/include/haproxy/defaults.h +++ b/include/haproxy/defaults.h @@ -39,9 +39,14 @@ #define MAX_THREADS LONGBITS #endif -/* still limited to 1 group for now by default (note: group ids start at 1) */ +/* theoretical limit is 64, though we'd rather not push it too far for now + * as some structures might be enlarged to be indexed per group. Let's start + * with 16 groups max, allowing to experiment with dual-socket machines + * suffering from up to 8 loosely coupled L3 caches. It's a good start and + * doesn't engage us too far. + */ #ifndef MAX_TGROUPS -#define MAX_TGROUPS 1 +#define MAX_TGROUPS 16 #endif #define MAX_THREADS_PER_GROUP LONGBITS #endif