The multi-threading model is a feature that allows HAProxy Enterprise to start multiple threads within a single process. With the multi-threading model, you benefit from the following features:
Information is shared between threads, such as configuration parameters, statistics, limits, and rates
Less health checking traffic
Runtime API commands become simpler compared with running in multi-process mode (e.g.
nbproc) because you do not need to issue commands against multiple processes or script loops
On platforms that support CPU affinity, multi-threading is enabled and the number of threads is automatically set to the number of CPUs the process is bound to upon startup. Otherwise, the number of threads is 1.
To change the number of threads HAProxy Enterprise runs, set the option
nbthread in the
global configuration section. Optionally, map threads to CPU cores using the configuration directive
global nbthread 4 # bind all threads of the first process on the first 4 CPUs cpu-map 1/all 0-3