You should definitely observe the load you're expecting. I suspect that some of your servers are regularly failing to respond to health checks and that they're regularly pulled out of the farm then reinserted once their load drops and they can respond again.
Also, how do you observe the unbalance ? The logs only log warnings (basically only downs).
Could you also check the stats page, you'll see how many sessions are sent to each server, how many times they're up/down, and if there has been some queuing or at least if they have reached their maxconn.
I don't think you can balance redirects. If the purpose of this deployment is to redirect all traffic to these servers from http to https, you'll want to listen on two separate IPs, and redirect accordingly. This will mean that the user must know the subdomains in advance.
What you're attempting to do strikes me as not so good. A user is going to hit your frontend URL, and be redirected to one of two subdomains. If they return, they may be redirected to the other subdomain. As a user, I'd find this extremely awkward.
The purpose of load balancing, is obscuring the implementation details of how many and what servers are in the cluster, and provide a uniform front end.
I'd suggest something along the lines of the following:
Frontend: 10.80.11.1:80 # http://blah.com/
Backend 1: 10.80.11.5:443
Backend 2: 10.80.11.6:443
In each of the backends, have their default page load at /gohere
rather than trying to get HA Proxy to rewrite the URL. Now you can load balance all you want, obscure the details from the user.
If you REALLY want to achieve the rewriting of the subdomains, you could attempt something like this:
Frontend: 10.80.11.1:80 # http://blah.com
balance roundrobin
Backend: server 10.80.11.2:80
Backend: server 10.80.11.3:80
Frontend: 10.80.11.2:80 # http://ssl1.blah.com
redirect location https://ss1.blah.com
Frontend: 10.80.11.3:80 # http://ssl2.blah.com
redirect location https://ssl2.blah.com
However, you'd need to install HA Proxy on all 3 hosts (unless any of the above backends share a host and have multiple NICs).
If you're using Apache as the backends, you can achieve https redirects very very simply and shouldn't manage this with HA Proxy.
Best Answer
There is a
weight
operator for theserver
line.This works withing a range
0
-256
where,0
bypasses a server from the loop.You should lookup these in the HAproxy Configuration.txt.
For a 75-15-15 distribution the weights should probably be 22-10-10.
I would expect the server lines to look like these, but please recheck with the notes or some better references.