HAProxy Config for Load balancing the servers

by Balasundaram

I tried using HAPRoxy for load balancing between the app servers as well as the database slaves.

The generic config for the HAPRoxy is

pidfile /tmp/haproxy-queue.pid

mode tcp
balance roundrobin
option httpclose
option forwardfor

listen redis
server server5 maxconn 1 check
server server6 maxconn 1 check


For getting realtime statistics

the below config is used and the port can be used to get the statistics

listen stats :1936
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /