Re: HAProxy - 504 Gateway Timeout error.

2011-07-18 Thread gidot
Willy Tarreau w at 1wt.eu writes:

 
 Hi,
 
 On Thu, Jul 14, 2011 at 10:21:56AM +, gidot wrote:
  Thanks Willy,
  
  I managed to fix the problem with the log. It's due to my entry in /etc/
  syslogd.conf. This thread http://www.serverphorums.com/read.php?
  10,127228,127867 helped me out :).
  
  Here is the excerpt of my haproxy.log. Hope someone can enlighten me if 
there's 
  anything obvious from this log that can help me to troubleshoot my problem. 
  Here's from grep'ing 504:
  
  Jul 13 20:37:57 localhost haproxy[98507]: 213.47.109.71:51261 [13/
  Jul/2011:20:37:07.967] webjailfarm webjailfarm/wj01 7/0/0/-1/+50009 504 
+194 - 
  - sHVN 62/62/52/12/0 0/0 GET /main.php?location=war HTTP/1.1 
 (...)
 
 All of these logs indicate that the server is simply not responding within
 50 seconds. As frustrating as this can be, this is something quite common
 when servers get overloaded or when they try to access a locked resource.
 The two following ones however are more concerning :
 
  Jul 13 20:41:25 localhost haproxy[98507]: 188.123.218.31:4180 [13/
  Jul/2011:20:40:35.132] webjailfarm webjailfarm/wj08 2/0/0/-1/+50005 504 
+194 - 
  - sHVN 78/78/61/4/0 0/0 GET /images/gamefavicons.png HTTP/1.1 
  Jul 13 20:43:36 localhost haproxy[98507]: 217.246.8.81:2284 [13/
  Jul/2011:20:42:46.796] webjailfarm webjailfarm/wj05 1/0/0/-1/+50003 504 
+194 - 
  - sHVN 56/56/46/0/0 0/0 GET /emptyicon.gif HTTP/1.1 
 
 I think that such resources are purely static and have no reason not to be
 quickly delivered. Is there any possibility that the same servers are
 accessed via other backend sections, or even directly without passing via
 haproxy ? I'm asking because what I suspect is that the server's connection
 limit is reached due to other activity, but the listening socket is not yet
 saturated, so our request lies in the server's backlog until a connection
 is released so that a process (or thread) can process the pending request
 (which did not happen in time here).
 
  And some others:
  
  Jul 13 20:38:08 localhost haproxy[98507]: 89.228.101.118:51199 [13/
  Jul/2011:20:38:08.893] webjailfarm webjailfarm/wj05 0/0/-1/-1/+1 503 +212 - 
- 
  SCDN 44/44/37/7/+3 0/0 POST /login.php HTTP/1.1 
 
 The connection was referencing a server which was already detected as DOWN
 (hence the D flag), so the health checks have noticed the event. The
 connection was redispatched onto another server (wj05) but the connection
 failed there. It could be the same thing as above, but with the backlog full,
 so the system is rejecting extra connections instead of queuing them. It
 could also be that you restarted the server and the connections were attempted
 while the port was not bound.
 
  Jul 13 20:38:14 localhost haproxy[98507]: 188.101.27.150:61567 [13/
  Jul/2011:20:38:14.883] webjailfarm webjailfarm/wj06 13/0/1/-1/+14 502 +204 
- - 
  SHVN 53/53/47/7/0 0/0 GET /js/scriptaculous.js?load=effects,slider 
HTTP/1.1 
 
 The 502s normally indicate that the server broke the connection without
 responding. This can be the consequence of a server restart as well as it
 can indicate dying processes.
 
  At the moment we're still having problems with clients receiving 502 and 
504 
  errors. It was quiet for the first few days after we have tuned the box, 
but 
  since 2 days ago, they're back.
 
 If you check your stats page, you should see that your servers state are
 changing a lot. A server must not flap, it must have a steady state. In
 my opinion, the fact that they're seen down is not the cause of the problem
 but one of the consequences : something is blocking your servers or making
 them process requests slowly and at one point they can't even process health
 checks anymore. Requests are aborted on timeouts and checks fail, causing
 the server to be marked down.
 
 This is normally what happens when servers connection limit gets overflown.
 You may want to try to increase your MaxClients or equivalent. Be careful
 though, as this can imply a higher memory usage.
 
 Another solution people generally like is to split dynamic/static contents,
 which is called content switching. You build a farm out of a very fast and
 scalable server such as nginx and send the static requests there. You keep
 the rest on current servers, the load should drop quite a bit.
 
  Btw, I tried to run the command echo show sess | socat stdio /var/run/
haproxy/
  haproxy.sock, and some entries show that it's not forwarding to any server 
  (none). Is this normal?
  
  [/root] # echo show sess | socat stdio /var/run/haproxy/haproxy.sock
  0x800fbfc00: proto=tcpv4 src=178.190.178.184:52094 fe=webjailfarm 
  be=webjailfarm srv=none ts=02 age=46s calls=1 rq
  [f=501000h,l=0,an=0eh,rx=3s,wx=,ax=] rp[f=001000h,l=0,an=00h,rx=,wx=,ax=] 
s0=
  [7,18h,fd=55,ex=] s1=[0,0h,fd=-1,ex=] exp=3s
 (...)
 
 It is normal for connections which have not yet sent a full request. In your
 case, the request buffer is empty so nothing was received from the client.
 Until you don't see 

HAProxy - 504 Gateway Timeout error.

2011-07-14 Thread gidot
Thanks Willy,

I managed to fix the problem with the log. It's due to my entry in /etc/
syslogd.conf. This thread http://www.serverphorums.com/read.php?
10,127228,127867 helped me out :).

Here is the excerpt of my haproxy.log. Hope someone can enlighten me if there's 
anything obvious from this log that can help me to troubleshoot my problem. 
Here's from grep'ing 504:

Jul 13 20:37:57 localhost haproxy[98507]: 213.47.109.71:51261 [13/
Jul/2011:20:37:07.967] webjailfarm webjailfarm/wj01 7/0/0/-1/+50009 504 +194 - 
- sHVN 62/62/52/12/0 0/0 GET /main.php?location=war HTTP/1.1 
Jul 13 20:38:08 localhost haproxy[98507]: 213.47.109.71:51265 [13/
Jul/2011:20:37:18.348] webjailfarm webjailfarm/wj01 45/0/0/-1/+50047 504 +194 - 
- sHVN 44/44/37/8/0 0/0 GET /main.php?location=war HTTP/1.1 
Jul 13 20:40:10 localhost haproxy[98507]: 2.202.200.168:56122 [13/ 
Jul 13 20:41:25 localhost haproxy[98507]: 188.123.218.31:4180 [13/
Jul/2011:20:40:35.132] webjailfarm webjailfarm/wj08 2/0/0/-1/+50005 504 +194 - 
- sHVN 78/78/61/4/0 0/0 GET /images/gamefavicons.png HTTP/1.1 
Jul 13 20:43:36 localhost haproxy[98507]: 217.246.8.81:2284 [13/
Jul/2011:20:42:46.796] webjailfarm webjailfarm/wj05 1/0/0/-1/+50003 504 +194 - 
- sHVN 56/56/46/0/0 0/0 GET /emptyicon.gif HTTP/1.1 
Jul 13 20:44:33 localhost haproxy[98507]: 41.141.73.47:2654 [13/
Jul/2011:20:43:43.659] webjailfarm webjailfarm/wj08 21/0/1/-1/+50023 504 +194 - 
- sHVN 175/175/166/18/0 0/0 GET /getCSS.php?css=
%2Fae1%2F68%2F4885%2E1255006208%2E104491%2Ecss HTTP/1.1 
Jul 13 20:44:38 localhost haproxy[98507]: 87.160.231.110:4937 [13/
Jul/2011:20:43:48.808] webjailfarm webjailfarm/wj01 16/0/0/-1/+50017 504 +194 - 
- sHVN 166/166/162/27/0 0/0 GET /main.php?
location=ausbildenunitid=5enforcename=yestraincount=20dotraining=yesbase
template=0unitname=Drachenritter 
HTTP/1.1 
Jul 13 20:44:42 localhost haproxy[98507]: 41.178.69.109:3476 [13/
Jul/2011:20:43:51.877] webjailfarm webjailfarm/wj04 17/0/0/-1/+50308 504 +194 - 
- sHVN 182/182/175/37/0 0/0 POST /main.php?
location=einheitenmultiple=yesaction=eggsearchunit=2163081confirm=yes 
HTTP/1.1 
Jul 13 20:44:44 localhost haproxy[98507]: 190.165.104.203:1659 [13/
Jul/2011:20:43:54.463] webjailfarm webjailfarm/wj03 16/0/0/-1/+50016 504 +194 - 
- sHVN 195/195/190/47/0 0/0 GET /main.php HTTP/1.1 
Jul 13 20:44:44 localhost haproxy[98507]: 178.190.206.19:51649 [13/
Jul/2011:20:43:54.700] webjailfarm webjailfarm/wj01 11/0/0/-1/+50013 504 +194 - 
- sHVN 186/186/182/30/0 0/0 GET /actions.php?
location=statusaction=markstatusreadcurtime=1310582637630 HTTP/1.1 


And some others:

Jul 13 20:38:08 localhost haproxy[98507]: 89.228.101.118:51199 [13/
Jul/2011:20:38:08.893] webjailfarm webjailfarm/wj05 0/0/-1/-1/+1 503 +212 - - 
SCDN 44/44/37/7/+3 0/0 POST /login.php HTTP/1.1 

Jul 13 20:38:14 localhost haproxy[98507]: 188.101.27.150:61567 [13/
Jul/2011:20:38:14.883] webjailfarm webjailfarm/wj06 13/0/1/-1/+14 502 +204 - - 
SHVN 53/53/47/7/0 0/0 GET /js/scriptaculous.js?load=effects,slider HTTP/1.1 

Jul 13 20:38:18 localhost haproxy[98507]: 89.228.65.164:49289 [13/
Jul/2011:20:38:18.818] webjailfarm webjailfarm/wj06 4/0/0/-1/+5 502 +204 - - 
SHVN 50/50/42/3/0 0/0 GET /js/slider.js HTTP/1.1 

Jul 13 20:38:19 localhost haproxy[98507]: 2.11.13.226:2047 [13/
Jul/2011:20:38:19.221] webjailfarm webjailfarm/wj08 8/0/-1/-1/+8 503 +212 - - 
SCDN 51/51/41/6/+3 0/0 GET /templates/templates/fr/langfile.js HTTP/1.1 

Jul 13 20:38:29 localhost haproxy[98507]: 217.247.188.220:3081 [13/
Jul/2011:20:38:29.536] webjailfarm webjailfarm/wj05 58/0/0/-1/+58 502 +204 - - 
SHVN 64/64/54/6/0 0/0 GET /images/de/gbg/cssgroup/standard.css HTTP/1.1

Jul 13 20:38:31 localhost haproxy[98507]: 89.186.148.213:2198 [13/
Jul/2011:20:38:31.764] webjailfarm webjailfarm/wj07 0/0/0/-1/+0 502 +204 - - 
SHVN 56/56/47/5/0 0/0 GET /js/scriptaculous.js?load=effects,slider HTTP/1.1


At the moment we're still having problems with clients receiving 502 and 504 
errors. It was quiet for the first few days after we have tuned the box, but 
since 2 days ago, they're back.


Btw, I tried to run the command echo show sess | socat stdio /var/run/haproxy/
haproxy.sock, and some entries show that it's not forwarding to any server 
(none). Is this normal?

[/root] # echo show sess | socat stdio /var/run/haproxy/haproxy.sock
0x800fbfc00: proto=tcpv4 src=178.190.178.184:52094 fe=webjailfarm 
be=webjailfarm srv=none ts=02 age=46s calls=1 rq
[f=501000h,l=0,an=0eh,rx=3s,wx=,ax=] rp[f=001000h,l=0,an=00h,rx=,wx=,ax=] s0=
[7,18h,fd=55,ex=] s1=[0,0h,fd=-1,ex=] exp=3s

0x800fc2600: proto=tcpv4 src=94.222.121.57:18221 fe=webjailfarm be=webjailfarm 
srv=wj01 ts=08 age=37s calls=6 rq[f=4909000h,l=0,an=00h,rx=13s,wx=,ax=] rp
[f=10b020h,l=0,an=00h,rx=,wx=,ax=] s0=[7,10h,fd=11,ex=] s1=[7,18h,fd=7,ex=] 
exp=13s

0x801a71800: proto=tcpv4 src=178.198.246.35:64612 fe=webjailfarm be=webjailfarm 
srv=none ts=02 age=34s calls=1 rq[f=501000h,l=0,an=0eh,rx=16s,wx=,ax=] rp
[f=001000h,l=0,an=00h,rx=,wx=,ax=] s0=[7,18h,fd=44,ex=] 

Re: HAProxy - 504 Gateway Timeout error.

2011-07-14 Thread Willy Tarreau
Hi,

On Thu, Jul 14, 2011 at 10:21:56AM +, gidot wrote:
 Thanks Willy,
 
 I managed to fix the problem with the log. It's due to my entry in /etc/
 syslogd.conf. This thread http://www.serverphorums.com/read.php?
 10,127228,127867 helped me out :).
 
 Here is the excerpt of my haproxy.log. Hope someone can enlighten me if 
 there's 
 anything obvious from this log that can help me to troubleshoot my problem. 
 Here's from grep'ing 504:
 
 Jul 13 20:37:57 localhost haproxy[98507]: 213.47.109.71:51261 [13/
 Jul/2011:20:37:07.967] webjailfarm webjailfarm/wj01 7/0/0/-1/+50009 504 +194 
 - 
 - sHVN 62/62/52/12/0 0/0 GET /main.php?location=war HTTP/1.1 
(...)

All of these logs indicate that the server is simply not responding within
50 seconds. As frustrating as this can be, this is something quite common
when servers get overloaded or when they try to access a locked resource.
The two following ones however are more concerning :

 Jul 13 20:41:25 localhost haproxy[98507]: 188.123.218.31:4180 [13/
 Jul/2011:20:40:35.132] webjailfarm webjailfarm/wj08 2/0/0/-1/+50005 504 +194 
 - 
 - sHVN 78/78/61/4/0 0/0 GET /images/gamefavicons.png HTTP/1.1 
 Jul 13 20:43:36 localhost haproxy[98507]: 217.246.8.81:2284 [13/
 Jul/2011:20:42:46.796] webjailfarm webjailfarm/wj05 1/0/0/-1/+50003 504 +194 
 - 
 - sHVN 56/56/46/0/0 0/0 GET /emptyicon.gif HTTP/1.1 

I think that such resources are purely static and have no reason not to be
quickly delivered. Is there any possibility that the same servers are
accessed via other backend sections, or even directly without passing via
haproxy ? I'm asking because what I suspect is that the server's connection
limit is reached due to other activity, but the listening socket is not yet
saturated, so our request lies in the server's backlog until a connection
is released so that a process (or thread) can process the pending request
(which did not happen in time here).

 And some others:
 
 Jul 13 20:38:08 localhost haproxy[98507]: 89.228.101.118:51199 [13/
 Jul/2011:20:38:08.893] webjailfarm webjailfarm/wj05 0/0/-1/-1/+1 503 +212 - - 
 SCDN 44/44/37/7/+3 0/0 POST /login.php HTTP/1.1 

The connection was referencing a server which was already detected as DOWN
(hence the D flag), so the health checks have noticed the event. The
connection was redispatched onto another server (wj05) but the connection
failed there. It could be the same thing as above, but with the backlog full,
so the system is rejecting extra connections instead of queuing them. It
could also be that you restarted the server and the connections were attempted
while the port was not bound.

 Jul 13 20:38:14 localhost haproxy[98507]: 188.101.27.150:61567 [13/
 Jul/2011:20:38:14.883] webjailfarm webjailfarm/wj06 13/0/1/-1/+14 502 +204 - 
 - 
 SHVN 53/53/47/7/0 0/0 GET /js/scriptaculous.js?load=effects,slider HTTP/1.1 

The 502s normally indicate that the server broke the connection without
responding. This can be the consequence of a server restart as well as it
can indicate dying processes.

 At the moment we're still having problems with clients receiving 502 and 504 
 errors. It was quiet for the first few days after we have tuned the box, but 
 since 2 days ago, they're back.

If you check your stats page, you should see that your servers state are
changing a lot. A server must not flap, it must have a steady state. In
my opinion, the fact that they're seen down is not the cause of the problem
but one of the consequences : something is blocking your servers or making
them process requests slowly and at one point they can't even process health
checks anymore. Requests are aborted on timeouts and checks fail, causing
the server to be marked down.

This is normally what happens when servers connection limit gets overflown.
You may want to try to increase your MaxClients or equivalent. Be careful
though, as this can imply a higher memory usage.

Another solution people generally like is to split dynamic/static contents,
which is called content switching. You build a farm out of a very fast and
scalable server such as nginx and send the static requests there. You keep
the rest on current servers, the load should drop quite a bit.

 Btw, I tried to run the command echo show sess | socat stdio 
 /var/run/haproxy/
 haproxy.sock, and some entries show that it's not forwarding to any server 
 (none). Is this normal?
 
 [/root] # echo show sess | socat stdio /var/run/haproxy/haproxy.sock
 0x800fbfc00: proto=tcpv4 src=178.190.178.184:52094 fe=webjailfarm 
 be=webjailfarm srv=none ts=02 age=46s calls=1 rq
 [f=501000h,l=0,an=0eh,rx=3s,wx=,ax=] rp[f=001000h,l=0,an=00h,rx=,wx=,ax=] s0=
 [7,18h,fd=55,ex=] s1=[0,0h,fd=-1,ex=] exp=3s
(...)

It is normal for connections which have not yet sent a full request. In your
case, the request buffer is empty so nothing was received from the client.
Until you don't see too many of them, you don't have to worry, those can be
port probes or similar. If you have enabled keep-alive on the client side,
it 

HAProxy - 504 Gateway Timeout error.

2011-07-06 Thread Gi Dot
Hi,

We have recently migrated our game servers from Linux to FreeBSD. We have 8
web servers running in jails, with HAProxy as load balancer. We also have
CARP configured in case of network failover.

carp is running as master on the 1st server(webm01), and backup on the 2nd
server(webm02). haproxy on both servers are actively running, though only
one is working at a time, depending on which server with carp acting as
master. Both servers have pf running as well.

We are running FreeBSD 8.2-RELEASE, haproxy-1.4.15, apache-2.2.19 and the
game is php coded.

Our network architecture is as follows. There is a backend database running
as well on a jail in a different server, which I excluded from the diagram
(hope the ascii diagram will be displayed well in the mail):


 +- wj01
  |


(webm01)  |-- wj02
user  carp  haproxy --+
   |  |-- wj03
   |  |
   | +- wj04
   |
   | +- wj05
   |  |
   |  |- wj06
 carp  haproxy --+
(webm02)  |- wj07
  |
 +- wj08


Our main problem at the moment is a lot of users (more than a hundred users)
have complained that they are getting a 504 Gateway Timeout error. This
normally happens at night (CEST), when most players start playing the game.
However, the load of our servers are consistently low at all time.

At the moment there is no obvious pattern as to when this error occurs.

Here is our haproxy.conf:

global
log /var/run/log local0 notice
maxconn 4096
daemon
chroot /var/run/haproxy
user haproxy
group haproxy
stats socket /var/run/haproxy/haproxy.sock uid 1005 gid 1005

defaults
logglobal
modehttp
optionhttpclose
optionforwardfor
optionhttplog
optiontcplog
optiondontlognull
optiontcpka
retries3
option redispatch
maxconn2000
timeout connect5000
timeout client 5
timeout server5

listenwebjailfarm 78.xx.xx.xx:80
mode http
cookieSERVERID insert nocache indirect
balanceroundrobin
option  httpclose
option forwardfor
option httpchk HEAD / HTTP/1.0
stats uri /haproxy-status
stats enable
stats auth admin:password

serverwj01 192.168.30.10:80 http://192.168.30.10/ cookie A weight
10 check inter 2000 rise 2 fall 2
serverwj02 192.168.30.20:80 http://192.168.30.20/ cookie B weight
10 check inter 2000 rise 2 fall 2
serverwj03 192.168.30.30:80 http://192.168.30.30/ cookie C weight
10 check inter 2000 rise 2 fall 2
serverwj04 192.168.30.40:80 http://192.168.30.40/ cookie D weight
10 check inter 2000 rise 2 fall 2
serverwj05 192.168.30.50:80 http://192.168.30.50/ cookie E weight
10 check inter 2000 rise 2 fall 2
serverwj06 192.168.30.60:80 http://192.168.30.60/ cookie F weight
10 check inter 2000 rise 2 fall 2
serverwj07 192.168.30.70:80 http://192.168.30.70/ cookie G weight
10 check inter 2000 rise 2 fall 2
serverwj08 192.168.30.80:80 http://192.168.30.80/ cookie H weight
10 check inter 2000 rise 2 fall 2


##


And here is our pf.conf (the exact same pf is running on webm02, only the
IPs changed accordingly):

### macros
webm01 = 78.xx.xx.xx
db = 10.10.10.101
carp_dev = carp0
ext_if = igb0
jail_if = igb0:0
trusted = { 192.168.30.0/24, 10.10.10.0/24, 78.xx.xx.xx/xx, 85.xx.xx.xx/xx
}
tcp_services = { x, 4949 }
ssh_ports = { x, x, x, x }
icmp_types = { echoreq, unreach }

# jails
wj01 = 192.168.30.10
wj02 = 192.168.30.20
wj03 = 192.168.30.30
wj04 = 192.168.30.40
jails = { $wj01 $wj02 $wj03 $wj04 }


### normalization
scrub in all


### translation
nat on $ext_if from $jails to !10.10.10.0/24 - ($jail_if)
rdr pass on $ext_if inet proto tcp from any to $webm01 port x - $wj01
### ssh redirect
rdr pass on $ext_if inet proto tcp from any to $webm01 port x - $wj02
rdr pass on $ext_if inet proto tcp from any to $webm01 port x - $wj03
rdr pass on $ext_if inet proto tcp from any to $webm01 port x - $wj04
rdr pass on $ext_if inet proto tcp from any to ($carp_dev) port 80 -
$webm01

### filtering - drop incoming everything
block in all
block return

### keep state of outgoing connections
pass out keep state

### skip loopback interface
set skip on { lo0 }

### spoofing protection for all interfaces
block 

Re: HAProxy - 504 Gateway Timeout error.

2011-07-06 Thread Hank A. Paulson

Try adding:
optionhttplog
under your listen, I am not sure what haproxy does if you say tcplog after 
saying httplog, so you want to make sure have httplog since those log entries 
provide more info. Run with option httplog on the listen during the busy 
time and post some examples of the full log entries for the 504s - obfuscated 
as needed. There are 6 or 8 fields that should give some clues to loading, 
timing, tcp connection disposition and other potential issues. If you switch 
to a frontend/backend config, I think the haproxy stats page provides slightly 
more info, but I don't use listen so I am not positive.


If you have a heavy / page, even HEADs every 2 seconds might be some load 
(because AFAIK php has to spin the whole page to know if it has changed 
depending on the frameworks used), maybe not. Remember, load can be low on the 
machines/jails and they might still be near or at their limit for sockets, 
file descriptors, etc - so be sure to check those.


Also you can obviously watch for the errors as they happen with something 
like:

tail -f /var/run/log | fgrep  504  | more

On 7/6/11 2:44 AM, Gi Dot wrote:

Hi,

We have recently migrated our game servers from Linux to FreeBSD. We have 8
web servers running in jails, with HAProxy as load balancer. We also have CARP
configured in case of network failover.

carp is running as master on the 1st server(webm01), and backup on the 2nd
server(webm02). haproxy on both servers are actively running, though only one
is working at a time, depending on which server with carp acting as master.
Both servers have pf running as well.

We are running FreeBSD 8.2-RELEASE, haproxy-1.4.15, apache-2.2.19 and the game
is php coded.

Our network architecture is as follows. There is a backend database running as
well on a jail in a different server, which I excluded from the diagram (hope
the ascii diagram will be displayed well in the mail):


  +- wj01
   |
 (webm01)  |-- wj02
user  carp  haproxy --+
|  |-- wj03
|  |
| +- wj04
|
| +- wj05
|  |
|  |- wj06
  carp  haproxy --+
 (webm02)  |- wj07
   |
  +- wj08

Our main problem at the moment is a lot of users (more than a hundred users)
have complained that they are getting a 504 Gateway Timeout error. This
normally happens at night (CEST), when most players start playing the game.
However, the load of our servers are consistently low at all time.

At the moment there is no obvious pattern as to when this error occurs.

Here is our haproxy.conf:

global
 log /var/run/log local0 notice
 maxconn 4096
 daemon
 chroot /var/run/haproxy
 user haproxy
 group haproxy
 stats socket /var/run/haproxy/haproxy.sock uid 1005 gid 1005

defaults
 logglobal
 modehttp
 optionhttpclose
 optionforwardfor
 optionhttplog
 optiontcplog
 optiondontlognull
 optiontcpka
 retries3
 option redispatch
 maxconn2000
 timeout connect5000
 timeout client 5
 timeout server5

listenwebjailfarm 78.xx.xx.xx:80
 mode http
 cookieSERVERID insert nocache indirect
 balanceroundrobin
 option  httpclose
 option forwardfor
 option httpchk HEAD / HTTP/1.0
 stats uri /haproxy-status
 stats enable
 stats auth admin:password

 serverwj01 192.168.30.10:80 http://192.168.30.10/ cookie A weight
10 check inter 2000 rise 2 fall 2
 serverwj02 192.168.30.20:80 http://192.168.30.20/ cookie B weight
10 check inter 2000 rise 2 fall 2
 serverwj03 192.168.30.30:80 http://192.168.30.30/ cookie C weight
10 check inter 2000 rise 2 fall 2
 serverwj04 192.168.30.40:80 http://192.168.30.40/ cookie D weight
10 check inter 2000 rise 2 fall 2
 serverwj05 192.168.30.50:80 http://192.168.30.50/ cookie E weight
10 check inter 2000 rise 2 fall 2
 serverwj06 192.168.30.60:80 http://192.168.30.60/ cookie F weight
10 check inter 2000 rise 2 fall 2
 serverwj07 192.168.30.70:80 http://192.168.30.70/ cookie G weight
10 check inter 2000 rise 2 fall 2
 serverwj08 192.168.30.80:80 http://192.168.30.80/ cookie H weight
10 check inter 2000 rise 2 fall 2


##


And here is our pf.conf (the exact same 

Re: HAProxy - 504 Gateway Timeout error.

2011-07-06 Thread Baptiste
hi,

Your maxconn seems a bit low if you have a lot of clients...
Maybe you should try increasing it or at lease increase the queue timeout.

As hank said, turn on http log, it will provide you very interesting
information about your issue.

cheers