[STATS] report the number of times each server was selected
One user reported that an indicator was missing in the statistics:
the number of times each server was selected by load balancing. It
is in fact the total number of sessions assigned to a server by the
load balancing algorithm. It should directly reflect the weight for
"fair" algorithms such as round-robin, since it will not account for
persistant connections.
It should help a lot tuning each server's weight depending on the
load it receives.
diff --git a/src/backend.c b/src/backend.c
index 6aa7eaf..d456afd 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -955,6 +955,8 @@
/* unknown balancing algorithm */
return SRV_STATUS_INTERNAL;
}
+ s->be->cum_lbconn++;
+ s->srv->cum_lbconn++;
}
else if (s->be->options & PR_O_HTTP_PROXY) {
if (!s->srv_addr.sin_addr.s_addr)