Discrepency on total connection errors in stats page

Hi there,

It is observed that total backend sessions connection errors does not match per session connection errors for the same backend.


From Exploring the HAProxy Stats Page - HAProxy Technologies it shows that

The Conn column shows the number of requests that encountered an error while trying to connect to the server.
So i expect sum(connection error per sum) == total shown at the bottom. That is not the case.

Note, we have patched haproxy with custom LB algorithm. Not sure if that should be effecting this metric.

Haproxy in-use is 2.2.

My understanding is that failed_conns is tracked per:

  1. server in a backend and
  2. per backend too

Looks like in my case, its 2 and one of the 6 places where be_counters.failed_conns is incremented is:

		/* note: it is guaranteed that srv == NULL here */
		if (!s->si[1].err_type) {
			s->si[1].err_type = SI_ET_CONN_ERR;

		_HA_ATOMIC_ADD(&s->be->be_counters.failed_conns, 1);
		return 1;

But i’m not sure about the other 5 cases.

Is there are place where this metric is well documented other than the blog?