Basic Weight Questions with HAProxy

haproxyload balancing

  1. Do weights assigned to servers only effect the balance within that particular backend?
  2. When implementing weights for the first time, if I give all the servers in a backend the same number, would that be the same as before when there we no weights?
  3. How do I calculate just how much traffic I am shiffting by adjust weights by certain amounts. For example:
    server web1 10.10.10.10 weight 100
    server web2 10.10.10.11 weight 100
    server web3 10.10.10.12 weight 90
    server web4 10.10.10.13 weight 90

Best Answer

  1. It should be.

  2. Yes.

    From haproxy config. The "weight" parameter is used to adjust the server's weight relative to other servers. All servers will receive a load proportional to their weight relative to the sum of all weights, so the higher the weight, the higher the load. The default weight is 1, and the maximal value is 256.

  3. It should be proportional as stated in 2.

Related Topic