RE: Balancing bytes in/out

From: John Lauro <john.lauro#covenanteyes.com>
Date: Thu, 13 Aug 2009 05:21:28 -0400


The biggest issue probably is that you are using cookies that will tie a client to a server. For me, I noticed it often takes over 3 days to get the first 80% of the traffic off if I mark a server as soft down as people never reboot or close the browser. If you have more random traffic and less regular visitors it might not take so long.

Leastconn is more accurate for how the servers look at that moment in time. However, it does not take into account all clients that closed the session but have a cookie for a server, and it's only used for clients that don't already have a cookie. Round robin or one of the other methods might work better, but it can take close to a week for you to know if it's any better or not as a large number of your users are already tied to a specific server with a cookie. I used to use roundrobin and I think it worked better with cookies, but currently I don't have any traffic requiring cookies and so leastconnn has been working better.

> -----Original Message-----
> From: Nelson Serafica [mailto:ntserafica#gmail.com]
> Sent: Thursday, August 13, 2009 1:23 AM
> To: HAproxy Mailing Lists
> Subject: Balancing bytes in/out
>
> I just install and run haproxy for almost 3 months now and found no
> problem with it. Its just that I just notice that in my MRTG, the
> traffic is not the same. HAPROXY has SERVER A and SERVER B as backend
> web server. In the mrtg, SERVER B has a lot traffic compare to SERVER
> A. I have enable stats and I notice that Bytes IN/OUT is not almost
> equal (see attachment). Here is the config of my haproxy:
>
> listen WEB_SERVERS 1.2.3.4:80
> mode http
> clitimeout 60000 # 16.6 Hrs.
> srvtimeout 30000 # 8.33 Hrs.
> contimeout 4000 # 1.11 Hrs.
> balance leastconn
> option forwardfor
> option httpclose
> cookie igx insert nocache indirect
> server WEBA 2.3.4.5:80 cookie igx1 maxconn 2500 inter 1000
> fastinter 200 fall 2 check
> server WEBB 2.3.4.6:80 cookie igx2 maxconn 2500 inter 1000
> fastinter 200 fall 2 check
> stats uri /my_stats
> stats realm Global\ statistics
> stats auth stats:password
> global
> maxconn 10000 # Total Max Connections.
> log 127.0.0.1 local0
> log 127.0.0.1 local1 notice
> daemon
> nbproc 1 # Number of processes
> user haproxy
> group haproxy
> chroot /var/chroot/haproxy
> defaults
> log global
> option httplog
> mode tcp
> clitimeout 60000 # 16.6 Hrs.
> srvtimeout 30000 # 8.33 Hrs.
> contimeout 4000 # 1.11 Hrs.
> retries 3
> option redispatch
> option httpclose
>
> Is there something I need to change in my config. I set it as leastconn
> to balance traffic but it isn't. Can haproxy knows to transfer request
> to other back end when it knows it has a much more traffic compare to
> other server?
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.392 / Virus Database: 270.13.47/2289 - Release Date:
> 08/12/09 18:12:00
Received on 2009/08/13 11:21

This archive was generated by hypermail 2.2.0 : 2009/08/13 11:30 CEST