BUG/MINOR: backend: use cum_sess counters instead of cum_conn

This commit is part of a serie to align counters usage between
frontends/listeners on one side and backends/servers on the other.

"stot" metric refers to the total number of sessions. On backend side,
it is interpreted as a number of streams. Previously, this was accounted
using <cum_sess> be_counters field for servers, but <cum_conn> instead
for backend proxies.

Adjust this by using <cum_sess> for both proxies and servers. As such,
<cum_conn> field can be removed from be_counters.

Note that several diagnostic messages which reports total frontend and
backend connections were adjusted to use <cum_sess>. However, this is an
outdated and misleading information as it does reports streams count on
backend side. These messages should be fixed in a separate commit.

This should be backported to all stable releases.
This commit is contained in:
Amaury Denoyelle
2024-04-04 18:08:46 +02:00
parent 93066be32d
commit c02ec9a9db
6 changed files with 9 additions and 10 deletions

View File

@@ -68,7 +68,6 @@ struct fe_counters {
/* counters used by servers and backends */
struct be_counters {
unsigned int conn_max; /* max # of active sessions */
long long cum_conn; /* cumulated number of received connections */
long long cum_sess; /* cumulated number of accepted connections */
long long cum_lbconn; /* cumulated number of sessions processed by load balancing (BE only) */
unsigned long last_sess; /* last session time */

View File

@@ -163,10 +163,10 @@ static inline void proxy_inc_fe_cum_sess_ver_ctr(struct listener *l, struct prox
_HA_ATOMIC_INC(&l->counters->cum_sess_ver[http_ver - 1]);
}
/* increase the number of cumulated connections on the designated backend */
/* increase the number of cumulated streams on the designated backend */
static inline void proxy_inc_be_ctr(struct proxy *be)
{
_HA_ATOMIC_INC(&be->be_counters.cum_conn);
_HA_ATOMIC_INC(&be->be_counters.cum_sess);
HA_ATOMIC_UPDATE_MAX(&be->be_counters.sps_max,
update_freq_ctr(&be->be_sess_per_sec, 1));
}

View File

@@ -176,7 +176,7 @@ void srv_set_dyncookie(struct server *s);
int srv_check_reuse_ws(struct server *srv);
const struct mux_ops *srv_get_ws_proto(struct server *srv);
/* increase the number of cumulated connections on the designated server */
/* increase the number of cumulated streams on the designated server */
static inline void srv_inc_sess_ctr(struct server *s)
{
_HA_ATOMIC_INC(&s->counters.cum_sess);