nbthread <number>
This setting is only available when support for threads was built in. It
- creates <number> threads for each created processes. It means if HAProxy is
- started in foreground, it only creates <number> threads for the first
- process. See also "nbproc".
+ makes haproxy run on <number> threads. This is exclusive with "nbproc". While
+ "nbproc" historically used to be the only way to use multiple processors, it
+ also involved a number of shortcomings related to the lack of synchronization
+ between processes (health-checks, peers, stick-tables, stats, ...) which do
+ not affect threads. As such, any modern configuration is strongly encouraged
+ to migrate away from "nbproc" to "nbthread". See also "nbproc".
pidfile <pidfile>
Writes PIDs of all daemons into file <pidfile>. This option is equivalent to
if (!global.tune.requri_len)
global.tune.requri_len = REQURI_LEN;
+ if (global.nbproc > 1 && global.nbthread > 1) {
+ ha_alert("config : cannot enable multiple processes if multiple threads are configured. Please use either nbproc or nbthread but not both.\n");
+ err_code |= ERR_ALERT | ERR_FATAL;
+ goto out;
+ }
+
pool_head_requri = create_pool("requri", global.tune.requri_len , MEM_F_SHARED);
pool_head_capture = create_pool("capture", global.tune.cookie_len, MEM_F_SHARED);