worker-id "pop7-node1-inst3-${HAPROXY_WORKER_ID}"
The identifier is exported as the HAPROXY_WORKER_ID environment variable (see
- section 2.3), is returned by the "worker_id" sample fetch function and on the
- output of the "show info" CLI command. See also the "HAPROXY_MASTER_ID"
- environment variable in section 2.3, and the "worker_id" sample fetch
- function.
+ section 2.3), is returned by the "worker_id" sample fetch function, appears
+ on the output of the "show info" CLI command and on the HTML stats page when
+ "stats show-node" is enabled. See also the "HAPROXY_MASTER_ID" environment
+ variable in section 2.3, and the "worker_id" sample fetch function.
wurfl-cache-size <size>
Sets the WURFL Useragent cache size. For faster lookups, already processed user
This statement is useful for users that offer shared services to their
customers, where node or description might be different on a stats page
provided for each customer. Default behavior is not to show host name.
+ When enabled, the identifiers of the master process (when present) and the
+ worker process are also shown. This can be useful to more easily detect
+ reloads for example. See "worker-id" in the global section.
Though this statement alone is enough to enable statistics reporting, it is
recommended to set all other settings in order to avoid relying on default
stats uri /admin?stats
stats refresh 5s
- See also: "show-desc", "stats enable", "stats uri", and "node" in global
- section.
+ See also: "show-desc", "stats enable", "stats uri", "worker-id" and "node" in
+ global section.
stats show-version
Enable statistics and show HAProxy version reporting
#include <haproxy/stats-html.h>
+#include <stdio.h>
#include <string.h>
#include <import/ist.h>
const char *scope_ptr = stats_scope_ptr(appctx);
struct uri_auth *uri;
unsigned long long bps;
+ /* large enough for two forced GUID_MAX_LEN identifiers and the tags */
+ char proc_ids[384] = "";
int thr;
BUG_ON(!ctx->http_px);
*/
bps = bps * 8 * 1538 / 1448;
+ /* The process' unique identifiers are reported along with the node
+ * name, as they're complementary. The master comes first so that the
+ * creation chain reads naturally, and it is absent when not running in
+ * master-worker mode. These identifiers are only made of characters
+ * which are valid in a GUID so they never need to be escaped.
+ */
+ if ((ctx->flags & STAT_F_SHNODE) && global.worker_id) {
+ snprintf(proc_ids, sizeof(proc_ids),
+ "%s%s%s<b>worker-id = </b> %s<br>\n",
+ global.master_id ? "<b>master-id = </b> " : "",
+ global.master_id ? global.master_id : "",
+ global.master_id ? "; " : "",
+ global.worker_id);
+ }
+
/* WARNING! this has to fit the first packet too.
* We are around 3.5 kB, add adding entries will
* become tricky if we want to support 4kB buffers !
"<h3>> General process information</h3>\n"
"<table border=0><tr><td align=\"left\" nowrap width=\"1%%\">\n"
"<p><b>pid = </b> %d (process #%d, nbproc = %d, nbthread = %d)<br>\n"
+ "%s"
"<b>uptime = </b> %dd %dh%02dm%02ds; warnings = %u<br>\n"
"<b>system limits:</b> memmax = %s%s; ulimit-n = %d<br>\n"
"<b>maxsock = </b> %d; <b>maxconn = </b> %d; <b>reached = </b> %llu; <b>maxpipes = </b> %d<br>\n"
(ctx->flags & STAT_F_SHDESC) ? ": " : "",
(ctx->flags & STAT_F_SHDESC) ? (uri->desc ? uri->desc : global.desc) : "",
pid, 1, 1, global.nbthread,
+ proc_ids,
up / 86400, (up % 86400) / 3600,
(up % 3600) / 60, (up % 60),
HA_ATOMIC_LOAD(&tot_warnings),