Re: Fwd: Need help to configure HA Proxy

From: Willy Tarreau <w#1wt.eu>
Date: Mon, 3 Nov 2008 08:00:31 +0100


Hi Yusuf,

On Mon, Nov 03, 2008 at 12:11:32PM +0530, Mohamed Yusuf - IT wrote:
> Hi Willy,
>
> Thanks for your replay.
>
> I will send you my configuration file by next mail. I have doubt.
>
> Nginx is running in Port 80 and Hostname is point to Nginx , then nginx is
> forward the request to haproxy...
>
> We have configured in nginx as mentioned below ,
>
>
> upstream images {
> server 127.0.0.1:2816;
>
> }
>
>
> HAProxy is running in 2816 port
>
> *HA Proxy configuration *
>
> global
> maxconn 4096 # Total Max Connections. This is dependent on
> ulimit
> daemon
> nbproc 4 # Number of processing cores. Dual Dual-core Opteron
> is 4 cores for example.

Here it's a bad idea to set "nbproc 4" if you're using mongrel, because you allow up to 4 haproxy processes to fight for a single mongrel connection. It could very well make the health-checks fail if your mongrels take too long to respond to some requests.

> pidfile /var/run/haproxy.pid
>
> defaults
> mode http
> clitimeout 60000
> srvtimeout 30000
> contimeout 4000
> option httpclose # Disable Keepalive
> balance roundrobin # Load Balancing algorithm
> option httpchk

Here, by default, the request is "HEAD / HTTP/1.0". You may need to check that your server correctly responds to this request. Otherwise you will have to change it for something else, or simply comment out this option.

> # option forwardfor # This sets X-Forwarded-For
> listen rails_proxy :2816
> #server mon01 127.0.0.1:7000 weight 1 minconn 1 maxconn 1 check inter 20s
> rise 2 fall 2 cookie first
> server mon01 127.0.0.1:8000 weight 1 minconn 1 maxconn 1
> server mon02 127.0.0.1:8001 weight 1 minconn 1 maxconn 1
> server mon03 127.0.0.1:8002 weight 1 minconn 1 maxconn 1
> server mon04 127.0.0.1:8003 weight 1 minconn 1 maxconn 1
> server mon05 127.0.0.1:8004 weight 1 minconn 1 maxconn 1
> -----------------------------------------
>
> How to *configure log files in haproxy.cfg*

add "log 127.0.0.1 local0" in your defaults section, and ensure that your local syslog listens to the UDP socket (if it is sysklogd, you need to pass it the "-r" option).

Willy Received on 2008/11/03 08:00

This archive was generated by hypermail 2.2.0 : 2008/11/03 08:15 CET