a namespace different from the default one. Please refer to your operating
system's documentation to find more details about network namespaces.
+nbconn <nbconn>
+ This setting is only valid for listener instances which uses reverse HTTP.
+ This will define the count of connections which will be mounted in parallel.
+ If not specified, a default value of 1 is used.
+
nice <nice>
Sets the 'niceness' of connections initiated from the socket. Value must be
in the range -1024..1024 inclusive, and defaults to zero. Positive values
char *file; /* file where the section appears */
int line; /* line where the section appears */
char *reverse_srvname; /* name of server when using "rev@" address */
+ int reverse_nbconn; /* count of connections to initiate in parallel */
__decl_thread(HA_RWLOCK_T sni_lock); /* lock the SNI trees during add/del operations */
struct thread_set thread_set; /* entire set of the allowed threads (0=no restriction) */
struct rx_settings settings; /* all the settings needed for the listening socket */
return 0;
}
+/* parse the "nbconn" bind keyword */
+static int bind_parse_nbconn(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
+{
+ int val;
+ const struct listener *l;
+
+ l = LIST_NEXT(&conf->listeners, struct listener *, by_bind);
+ if (l->rx.addr.ss_family != AF_CUST_REV_SRV) {
+ memprintf(err, "'%s' : only valid for reverse HTTP listeners.", args[cur_arg]);
+ return ERR_ALERT | ERR_FATAL;
+ }
+
+ if (!*args[cur_arg + 1]) {
+ memprintf(err, "'%s' : missing value.", args[cur_arg]);
+ return ERR_ALERT | ERR_FATAL;
+ }
+
+ val = atol(args[cur_arg + 1]);
+ if (val <= 0) {
+ memprintf(err, "'%s' : invalid value %d, must be > 0.", args[cur_arg], val);
+ return ERR_ALERT | ERR_FATAL;
+ }
+
+ conf->reverse_nbconn = val;
+ return 0;
+}
+
/* parse the "nice" bind keyword */
static int bind_parse_nice(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
{
{ "id", bind_parse_id, 1 }, /* set id of listening socket */
{ "maxconn", bind_parse_maxconn, 1 }, /* set maxconn of listening socket */
{ "name", bind_parse_name, 1 }, /* set name of listening socket */
+ { "nbconn", bind_parse_nbconn, 1 }, /* set number of connection on active preconnect */
{ "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 */
listener->rx.reverse_connect.task = task;
listener->rx.reverse_connect.state = LI_PRECONN_ST_STOP;
- /* Set a default maxconn to 1. This ensures listener is properly
- * reenable each time we fall back below it on connection error.
+ /* Set maxconn which is defined via the special kw nbconn for reverse
+ * connect. Use a default value of 1 if not set. This guarantees that
+ * listener will be automatically reenable each time it fell back below
+ * it due to a connection error.
*/
+ listener->bind_conf->maxconn = listener->bind_conf->reverse_nbconn;
if (!listener->bind_conf->maxconn)
listener->bind_conf->maxconn = 1;
{
if (l->rx.reverse_connect.state < LI_PRECONN_ST_FULL) {
send_log(l->bind_conf->frontend, LOG_INFO,
- "preconnect %s::%s: Reaching maxconn %d.\n",
+ "preconnect %s::%s: Running with nbconn %d reached.\n",
l->bind_conf->frontend->id, l->bind_conf->reverse_srvname,
l->bind_conf->maxconn);
l->rx.reverse_connect.state = LI_PRECONN_ST_FULL;