Hi,
I’m running HAProxy 1.5.18 to front a MySQL Percona XtraDB (57-5.7.25-31) Cluster with everything generally setup as per the guidelines elsewhere on the Percona site.
Things are generally working but I’m seeing that the “Current Sessions” statistic is not updating as I would expect for a backend that has gone down then come back up again.
Its therefore pretty confusing to get an accurate picture of which backend mysql node is taking all the traffic.
Here’s the frontend/backend config I’m using:
Here’s what I’ve tried:
-
Start my application up - this makes 50 connections to the DB (via HAProxy) hence the “current sessions” stat in the HAProxy UI shows as 50 for the backend that is the active one (percona-node1 in my case). I verify this using netstat to check the number of connections between HAProxy and the backend MySQL Node.
-
I then shutdown the backend mysql node with all the connections (percona-node1) and let HAProxy failover connections to the next backend in the list (percona-node2). I verify using netstat that HAProxy has 0 connections to the old backend (obviously) and now has 50 connections to the new backend. The “current sessions” stat in the HAProxy UI shows as 50 for the new backend but typically has a number <50 for the old backend.
-
I then bring the old backend mysql node back up again (percona-node1). I verify again using netstat that HAProxy has 0 connections to the newly restarted backend and maintains its 50 connections to the backend percona-node2. The “current sessions” stat in the HAProxy UI shows the same non-zero number for percona-node1 as before and 50 for percona-node2. I would expect it to show 0 for percona-node1 and 50 for percona-node2.
So does the current sessions stats not get cleared down for a node that has gone down then come back again?
Alternatively if anyone can recommend a better (and ideally free) management/status UI for HAProxy that would be great
Thanks in advance for your wisdom.