Apologies if this has been discussed. I couldn’t find it if so. I’m wondering how the weight variable interacts with maxconn on the backends. Suppose I have a backend like this:
balance leastconn
server server1 192.168.1.1:80 check maxconn 25
server server2 192.168.1.2:80 check maxconn 25
I assume that if server2 hits 25 connections, HAProxy will push any excess connections to server1, unless server2 is also maxed out? (I also assume that balance roundrobin would do the same?)
But what happens if I add weights to the entries? Suppose I have a backend like this, where the maxconn variables are the same but the weight variables are considerably different:
balance roundrobin
server server1 192.168.1.1:80 check maxconn 25 weight 10
server server2 192.168.1.2:80 check maxconn 25 weight 90
Obviously, by design, server2 will hit its maximum connections long before server1. What happens next? Does HAProxy then ignore the weighting and push any further requests to server1 until its maxconn value is met, too? Or does it start queuing any requests that would have been sent to server2, thereby “wasting” the excess capacity on server1?
Thanks!
1 post - 1 participant