Balancing bytes in/out

From: Nelson Serafica <ntserafica#gmail.com>
Date: Thu, 13 Aug 2009 13:22:52 +0800


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?

haproxy.PNG
Received on 2009/08/13 07:22

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