Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm attempting to modify my current haproxy configuration to favor 1 server over the others (70%,15,15) Does anyone know if this is possible? Reading the docs I see a "weight" option, but I'm a bit weary of messing around with production servers.

Here's my current config:

listen MySQL
   mode tcp
   balance roundrobin
   option persist
   server sql1
   server sql2
   server sql3
share|improve this question

There is a weight operator for the server 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.

   server sql1 weight 22
   server sql2 weight 10
   server sql3 weight 10
share|improve this answer
I want to learn how do you calculate these weights: > For a 75-15-15 distribution the weights should probably be 22-10-10 Thanks in advance. – user138619 Sep 26 '12 at 22:48
Where did those weights come from?? Haproxy should use the weight in linear propotion to the total weight. So 22-10-10 = 52% 24% 24%. That's not 70-15-15, which are the numbers he should actually use if he wants that distribution. – Chris S Sep 27 '12 at 1:45 is an easier link for the documentation. – Xiong Chiamiov Oct 22 '12 at 21:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.