[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/include/types/proxy.h b/include/types/proxy.h
index 9d1fae6..240b99b 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -184,6 +184,7 @@
unsigned int feconn, feconn_max; /* # of active frontend sessions */
unsigned int beconn, beconn_max; /* # of active backend sessions */
unsigned int cum_feconn, cum_beconn; /* cumulated number of processed sessions */
+ unsigned int cum_lbconn; /* cumulated number of sessions processed by load balancing */
unsigned int maxconn; /* max # of active sessions on the frontend */
unsigned int fullconn; /* #conns on backend above which servers are used at full load */
struct in_addr except_net, except_mask; /* don't x-forward-for for this address. FIXME: should support IPv6 */
diff --git a/include/types/server.h b/include/types/server.h
index 614775b..5c47d17 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -116,6 +116,7 @@
unsigned retries; /* retried connections */
unsigned failed_secu; /* blocked responses because of security concerns */
unsigned cum_sess; /* cumulated number of sessions really sent to this server */
+ unsigned cum_lbconn; /* cumulated number of sessions directed by load balancing */
long long bytes_in; /* number of bytes transferred from the client to the server */
long long bytes_out; /* number of bytes transferred from the server to the client */