Add a new option, "stats calculate-max-counters [on|off]".
It makes it possible to disable the calculation of max counters, as they
can have a performance cost.
certificates. It's useless for BoringSSL, .issuer is ignored because ocsp
bits does not need it. Requires at least OpenSSL 1.0.2.
+stats calculate-max-counters [on|off]
+ Activates or deactivates the calculation of stats max counters. If you
+ don't need them, deactivating them may increase performances a bit.
+ The default is on.
+
stats maxconn <connections>
By default, the stats socket is limited to 10 concurrent connections. It is
possible to change this value with "stats maxconn".
#include <haproxy/counters-t.h>
#include <haproxy/guid-t.h>
+#include <haproxy/global.h>
extern THREAD_LOCAL void *trash_counters;
#define COUNTERS_UPDATE_MAX(counter, count) \
do { \
- HA_ATOMIC_UPDATE_MAX(counter, count); \
+ if (!(global.tune.options & GTUNE_NO_MAX_COUNTER)) \
+ HA_ATOMIC_UPDATE_MAX(counter, count); \
} while (0)
/* Manipulation of extra_counters, for boot-time registrable modules */
#define GTUNE_LISTENER_MQ_OPT (1<<28)
#define GTUNE_LISTENER_MQ_ANY (GTUNE_LISTENER_MQ_FAIR | GTUNE_LISTENER_MQ_OPT)
#define GTUNE_NO_KTLS (1<<29)
+#define GTUNE_NO_MAX_COUNTER (1<<30)
/* subsystem-specific debugging options for tune.debug */
#define GDBG_CPU_AFFINITY (1U<< 0)
}
global.cli_fe->maxconn = maxconn;
}
+ else if (strcmp(args[1], "calculate-max-counters") == 0) {
+ if (!strcasecmp(args[2], "on"))
+ return 0;
+ else if (!strcasecmp(args[2], "off")) {
+ global.tune.options |= GTUNE_NO_MAX_COUNTER;
+ return 0;
+ }
+ memprintf(err, "'%s' only supports 'on' and 'off', received '%s'", args[1], args[2]);
+ return -1;
+ }
else if (strcmp(args[1], "bind-process") == 0) {
memprintf(err, "'%s %s' is not supported anymore.", args[0], args[1]);
return -1;
}
else {
- memprintf(err, "'%s' only supports 'socket', 'maxconn', 'bind-process' and 'timeout' (got '%s')", args[0], args[1]);
+ memprintf(err, "'%s' only supports 'socket', 'maxconn', 'bind-process', 'calculate-max-counters' and 'timeout' (got '%s')", args[0], args[1]);
return -1;
}
return 0;