all | odd | even | number[-[number]]
- Ranges can be partially defined. The higher bound can be omitted. In such
+ Ranges can be partially defined. The higher bound can be omitted. In such a
case, it is replaced by the corresponding maximum value. The main purpose is
to have multiple bind lines sharing the same IP:port but not the same thread
in a listener, so that the system can distribute the incoming connections
into multiple queues, bypassing haproxy's internal queue load balancing.
Currently Linux 3.9 and above is known for supporting this.
+ This directive is deprecated in favor of the more suited "thread" directive
+ below, and will be removed in 2.7.
+
proto <name>
Forces the multiplexer's protocol to use for the incoming connections. It
must be compatible with the mode of the frontend (TCP or HTTP). It must also
need to build HAProxy with USE_TFO=1 if your libc doesn't define
TCP_FASTOPEN.
+thread <thread-set>
+ This restricts the list of threads on which this listener is allowed to run.
+ It does not enforce any of them but eliminates those which do not match. It
+ limits the threads allowed to process incoming connections for this listener.
+ For the unlikely case where several ranges are needed, this directive may be
+ repeated. <thread-set> must use the format:
+
+ all | odd | even | number[-[number]]
+
+ Ranges can be partially defined. The higher bound can be omitted. In such a
+ case, it is replaced by the corresponding maximum value. The main purpose is
+ to have multiple bind lines sharing the same IP:port but not the same thread
+ in a listener, so that the system can distribute the incoming connections
+ into multiple queues, bypassing haproxy's internal queue load balancing.
+ Currently Linux 3.9 and above is known for supporting this.
+
tls-ticket-keys <keyfile>
Sets the TLS ticket keys file to load the keys from. The keys need to be 48
or 80 bytes long, depending if aes128 or aes256 is used, encoded with base64
}
conf->settings.bind_thread |= thread;
- return 0;
+
+ memprintf(err, "'process %s' on 'bind' lines is deprecated and will be removed in 2.7.", args[cur_arg+1]);
+ if (slash)
+ memprintf(err, "%s Please use 'thread %s' instead.", *err, slash + 1);
+ return ERR_WARN;
}
/* parse the "proto" bind keyword */
return 0;
}
+/* parse the "thread" bind keyword */
+static int bind_parse_thread(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
+{
+ char *slash;
+ unsigned long thread = 0;
+
+ if ((slash = strchr(args[cur_arg + 1], '/')) != NULL)
+ *slash = 0;
+
+ if (slash) {
+ *slash = '/';
+ memprintf(err, "'%s': thread groups not supported", args[cur_arg+1]);
+ return ERR_ALERT | ERR_FATAL;
+ }
+
+ if (parse_process_number(args[cur_arg+1], &thread, MAX_THREADS, NULL, err)) {
+ memprintf(err, "'%s' : %s", args[cur_arg+1], *err);
+ return ERR_ALERT | ERR_FATAL;
+ }
+
+ conf->settings.bind_thread |= thread;
+ return 0;
+}
+
/* config parser for global "tune.listener.multi-queue", accepts "on" or "off" */
static int cfg_parse_tune_listener_mq(char **args, int section_type, struct proxy *curpx,
const struct proxy *defpx, const char *file, int line,
{ "nice", bind_parse_nice, 1 }, /* set nice of listening socket */
{ "process", bind_parse_process, 1 }, /* set list of allowed process for this socket */
{ "proto", bind_parse_proto, 1 }, /* set the proto to use for all incoming connections */
+ { "thread", bind_parse_thread, 1 }, /* set list of allowed threads for this socket */
{ /* END */ },
}};