Re: weights

2014-03-04 Thread vijeesh vijayan
Thanks. Am talking about the weights , if one server (x) assigned with
weight 125 and other server (y) with weight 12 ( added twice in the file) ,
we see x is getting half of the traffic compared to y. that means weigt has
no affects here?


On Tue, Mar 4, 2014 at 12:15 PM, Willy Tarreau w...@1wt.eu wrote:

 On Sat, Mar 01, 2014 at 11:06:32PM +0530, vijeesh vijayan wrote:
  Thanks. will share screenshot shortly. roundrobin recommented for mysql
  also?

 What Baptiste is explaining is that leastconn focuses on balancing
 the number of established connections and not the cumulated number
 of connections. If one server responds slowly and the other responds
 fast, the slow one will always have a certain number of open
 connections while the fast one will have very few. Thus it is normal
 that haproxy will pick the fast one more often than the slow one. And
 this is precisely the purpose of leastconn.

 Some people use leastconn to avoid servers which are suffering from
 some local system perturbations (eg: backups). And in general, what
 you're observing means exactly that one server is working much better
 than another one.

 So round robin will equally distribute the number of requests to your
 servers, but will degrade the quality of service since the slow one
 will get more requests than right now, and the fast one will remain
 mostly idle waiting for the slow one to get its share.

 Willy




-- 
=
Vijeesh K
The temptation to quit will be greatest just before you are about to
succeed


Re: weights

2014-03-04 Thread vijeesh vijayan
This distribution happens only when server x and y has same number of open
connections?


On Tue, Mar 4, 2014 at 3:10 PM, Willy Tarreau w...@1wt.eu wrote:

 On Tue, Mar 04, 2014 at 02:20:32PM +0530, vijeesh vijayan wrote:
  Thanks. Am talking about the weights , if one server (x) assigned with
  weight 125 and other server (y) with weight 12 ( added twice in the
 file) ,
  we see x is getting half of the traffic compared to y. that means weigt
 has
  no affects here?

 Yes it does affect it. In leastconn, the weight affects the number of
 concurrent connections. So if a server has a weight of 125 and another
 one of 2, then haproxy will ensure that the first one has 125/127
 connections while the second has 2/127 connections. But again, these
 are *concurrent* connections, not cumulated connections.

 Willy




-- 
=
Vijeesh K
The temptation to quit will be greatest just before you are about to
succeed


Re: weights

2014-03-04 Thread vijeesh vijayan
Thanks. please check my last reply

 Thanks. Am talking about the weights , if one server (x) assigned with
weight 125 and other server (y) with weight 12 ( added twice in the file) ,
we see x is getting half of the traffic compared to y. that means weigt has
no affects here?

in this case , server x should be getting 5 folds of connections of y
ideally. but something is preventing this . Am i right? in our case x is
getting only 50 percent of y ( we are calculating the number of
connections/sec) . how do we know how many connections haproxy keep it open
for a particular server?


On Tue, Mar 4, 2014 at 7:52 PM, Willy Tarreau w...@1wt.eu wrote:

 On Tue, Mar 04, 2014 at 07:50:04PM +0530, vijeesh vijayan wrote:
  This distribution happens only when server x and y has same number of
 open
  connections?

 no, the distribution happens all the time. To make it simpler to
 understand,
 imagine that you have weight=1 for all servers. Haproxy will then try to
 balance the established connections so that all servers have the same
 number.
 Now if one server has weight 2, haproxy will try to load it with twice the
 number of connections as the first one. And so on... That's why leastconn
 is normally used with long-lived connections (eg: RDP, LDAP, SQL, ...).

 Willy




-- 
=
Vijeesh K
The temptation to quit will be greatest just before you are about to
succeed


Re: weights

2014-03-01 Thread vijeesh vijayan
Thanks. will share screenshot shortly. roundrobin recommented for mysql
also?


On Fri, Feb 28, 2014 at 3:22 PM, Baptiste bed...@gmail.com wrote:

 Hi,

 this may be due to your load-balancing algorithm and the speed of your
 servers.
 leastconn applies to currently established connections, not to number
 of connections established per second.

 could you enable haproxy stats page and share us (or to me directly) a
 screenshot of it?

 You could give a try to 'balance roundrobin' and see what happens.

 Baptiste


 On Fri, Feb 28, 2014 at 9:41 AM, vijeesh vijayan
 vijeeshk.vija...@gmail.com wrote:
  we are using haproxy (1.4)to distribute traffic to 30 of our db nodes.
  we are facing an issue with weights.
 
  sample configs
 
  =
  defaults
  mode   tcp
  retries2
  option redispatch
  maxconn256000
  timeoutconnect   10s
  timeoutclient10s
  timeoutserver10s
 
 
  log global
 
  option dontlognull
 
 
 
  listen newone :4000
  mode tcp
 
  balance leastconn
  option mysql-check user abcd
 
 
  serverx.x.x.3:3306   weight 125   check inter 3s  rise 2  fall 2
 
  server y.com   x.x.x.4:3306   weight 12   check inter 3s  rise 2 fall 2
  server y.com   x.x.x.4:3306   weight 12   check inter 3s  rise 2 fall 2
  =
 
 
   issue is we are getting only 150qps on server x.com even with weight
 125.
 
  but on y.com we are getting 500qps with a weight of 12 , but mentioned
  twice.
 
 
  can you explain why it is so?
 
 
 
  --
  =
  Vijeesh K
  The temptation to quit will be greatest just before you are about to
  succeed




-- 
=
Vijeesh K
The temptation to quit will be greatest just before you are about to
succeed


weights

2014-02-28 Thread vijeesh vijayan
we are using haproxy (1.4)to distribute traffic to 30 of our db nodes.
we are facing an issue with weights.

sample configs

=
defaults
mode   tcp
retries2
option redispatch
maxconn256000
timeoutconnect   10s
timeoutclient10s
timeoutserver10s


log global

option dontlognull



listen newone :4000
mode tcp

balance leastconn
option mysql-check user abcd


serverx.x.x.3:3306   weight 125   check inter 3s  rise 2  fall 2

server y.com   x.x.x.4:3306   weight 12   check inter 3s  rise 2 fall 2
server y.com   x.x.x.4:3306   weight 12   check inter 3s  rise 2 fall 2
=


 issue is we are getting only 150qps on server x.com even with weight 125.

but on y.com we are getting 500qps with a weight of 12 , but mentioned
twice.


can you explain why it is so?


-- 
=
Vijeesh K
The temptation to quit will be greatest just before you are about to
succeed