Re: Error 504

2011-09-12 Thread Christophe Rahier
Hi Willy,

Thank you very much for your help

Christophe


Le 12/09/11 09:22, « Willy Tarreau »  a écrit :

>On Mon, Sep 12, 2011 at 12:02:55AM -0700, Christophe Rahier wrote:
>> Hi Willy,
>> 
>> Thank you!
>> 
>> I'm just confused now :-) Which values have I to use?
>
>Replace any old form with the newer, this will bring you the following :
>
>   timeout client 35s
>   timeout server 60s
>   timeout connect 35s(far too large in general, keep it around 5s)
>   timeout http-keep-alive 10s
>
>If your servers have long response times because it's overloaded, you
>might want to consider adding "maxconn XXX" on the server lines, where
>XXX is the maximum number of concurrent connections you know it supports
>without overloading. The excess will be queued. You then also need a
>timeout for this queue which is close to the max response time :
>
>   timeout queue 60s
>
>> global
>> log 192.168.0.2 local0
>> log 127.0.0.1 local1 notice
>> maxconn 10240
>> defaults
>> logglobal
>> option dontlognull
>> retries2
>> clitimeout  35s
>> #srvtimeout  5
>> contimeout  35s
>> #timeout server 60s
>> timeout http-keep-alive 10s
>> 
>> listen WebPlayer-Farm 192.168.0.2:80
>> mode http
>> option httplog
>> balance source
>> #balance leastconn
>> option forwardfor
>> stats enable
>> option http-server-close
>> server Player1 192.168.0.10:80 check
>> server Player2 192.168.0.11:80 check
>> server Player3 192.168.0.12:80 check
>> server Player4 192.168.0.13:80 check
>> server Player5 192.168.0.14:80 check
>
>Regards,
>Willy
>
>
>





Re: Error 504

2011-09-12 Thread Willy Tarreau
On Mon, Sep 12, 2011 at 12:02:55AM -0700, Christophe Rahier wrote:
> Hi Willy,
> 
> Thank you!
> 
> I'm just confused now :-) Which values have I to use?

Replace any old form with the newer, this will bring you the following :

   timeout client 35s
   timeout server 60s
   timeout connect 35s(far too large in general, keep it around 5s)
   timeout http-keep-alive 10s

If your servers have long response times because it's overloaded, you
might want to consider adding "maxconn XXX" on the server lines, where
XXX is the maximum number of concurrent connections you know it supports
without overloading. The excess will be queued. You then also need a
timeout for this queue which is close to the max response time :

   timeout queue 60s

> global
> log 192.168.0.2 local0
> log 127.0.0.1 local1 notice
> maxconn 10240
> defaults
> logglobal
> option dontlognull
> retries2
> clitimeout  35s
> #srvtimeout  5
> contimeout  35s
> #timeout server 60s
> timeout http-keep-alive 10s
> 
> listen WebPlayer-Farm 192.168.0.2:80
> mode http
> option httplog
> balance source
> #balance leastconn
> option forwardfor
> stats enable
> option http-server-close
> server Player1 192.168.0.10:80 check
> server Player2 192.168.0.11:80 check
> server Player3 192.168.0.12:80 check
> server Player4 192.168.0.13:80 check
> server Player5 192.168.0.14:80 check

Regards,
Willy




Re: Error 504

2011-09-12 Thread Christophe Rahier
Hi Willy,

Thank you!

I'm just confused now :-) Which values have I to use?

global
log 192.168.0.2 local0
log 127.0.0.1 local1 notice
maxconn 10240
defaults
logglobal
option dontlognull
retries2
clitimeout  35s
#srvtimeout  5
contimeout  35s
#timeout server 60s
timeout http-keep-alive 10s

listen WebPlayer-Farm 192.168.0.2:80
mode http
option httplog
balance source
#balance leastconn
option forwardfor
stats enable
option http-server-close
server Player1 192.168.0.10:80 check
server Player2 192.168.0.11:80 check
server Player3 192.168.0.12:80 check
server Player4 192.168.0.13:80 check
server Player5 192.168.0.14:80 check


Thanks for your help.

Regards,

Christophe







Le 12/09/11 06:49, « Willy Tarreau »  a écrit :

>On Sun, Sep 11, 2011 at 11:11:04AM -0700, Christophe Rahier wrote:
>> Hi Cyril,
>> 
>> Thanks for your help, I'll adapt my config file.
>> 
>> About timeout http-keep-alive, which value do you recommend?
>
>Generally, a short one is fine : you want to ensure that all objects
>from a same page are all fetched without reopening many connections,
>but you probably don't want to keep these connections open for too
>long. This means that a few seconds (eg: 5-10) are fine.
>
>Regards,
>Willy
>
>





Re: Error 504

2011-09-11 Thread Baptiste
5 or 10s sounds good :)

cheers

On Sun, Sep 11, 2011 at 8:11 PM, Christophe Rahier
 wrote:
> Hi Cyril,
>
> Thanks for your help, I'll adapt my config file.
>
> About timeout http-keep-alive, which value do you recommend?
>
> Christophe
>
>
> Le 11/09/11 13:34, « Cyril Bonté »  a écrit :
>
>>Hi Christophe,
>>
>>Le Jeudi 8 Septembre 2011 05:28:41 Christophe Rahier a écrit :
>>> defaults
>>> log    global
>>> option dontlognull
>>> retries    2
>>> clitimeout  5
>>> srvtimeout  5
>>> contimeout  5
>>> timeout server 60s
>>
>>Be careful beacause your configuration provides both the deprecated
>>"srvtimeout" keyword and "timeout server", the latest declared will apply.
>>You should clean up your configuration by using only non deprecated
>>keywords :
>>"timeout client", "timeout server" and "timeout connect".
>>
>>It means that your server timeout is not 5 but 60s.
>>
>>Also, because your proxies are using "option http-server-close", you
>>should
>>define a "timeout http-keep-alive" to reduce the ttl of idle keep-alive
>>connections.
>>
>>--
>>Cyril Bonté
>>
>
>
>



Re: Error 504

2011-09-11 Thread Willy Tarreau
On Sun, Sep 11, 2011 at 11:11:04AM -0700, Christophe Rahier wrote:
> Hi Cyril,
> 
> Thanks for your help, I'll adapt my config file.
> 
> About timeout http-keep-alive, which value do you recommend?

Generally, a short one is fine : you want to ensure that all objects
from a same page are all fetched without reopening many connections,
but you probably don't want to keep these connections open for too
long. This means that a few seconds (eg: 5-10) are fine.

Regards,
Willy




Re: Error 504

2011-09-11 Thread Christophe Rahier
Hi Cyril,

Thanks for your help, I'll adapt my config file.

About timeout http-keep-alive, which value do you recommend?

Christophe


Le 11/09/11 13:34, « Cyril Bonté »  a écrit :

>Hi Christophe,
>
>Le Jeudi 8 Septembre 2011 05:28:41 Christophe Rahier a écrit :
>> defaults
>> logglobal
>> option dontlognull
>> retries2
>> clitimeout  5
>> srvtimeout  5
>> contimeout  5
>> timeout server 60s
>
>Be careful beacause your configuration provides both the deprecated
>"srvtimeout" keyword and "timeout server", the latest declared will apply.
>You should clean up your configuration by using only non deprecated
>keywords :
>"timeout client", "timeout server" and "timeout connect".
>
>It means that your server timeout is not 5 but 60s.
>
>Also, because your proxies are using "option http-server-close", you
>should 
>define a "timeout http-keep-alive" to reduce the ttl of idle keep-alive
>connections.
>
>-- 
>Cyril Bonté
>





Re: Error 504

2011-09-11 Thread Cyril Bonté
Hi Christophe,

Le Jeudi 8 Septembre 2011 05:28:41 Christophe Rahier a écrit :
> defaults
> logglobal
> option dontlognull
> retries2
> clitimeout  5
> srvtimeout  5
> contimeout  5
> timeout server 60s

Be careful beacause your configuration provides both the deprecated 
"srvtimeout" keyword and "timeout server", the latest declared will apply.
You should clean up your configuration by using only non deprecated keywords :
"timeout client", "timeout server" and "timeout connect".

It means that your server timeout is not 5 but 60s.

Also, because your proxies are using "option http-server-close", you should 
define a "timeout http-keep-alive" to reduce the ttl of idle keep-alive 
connections.

-- 
Cyril Bonté



Re: Error 504

2011-09-11 Thread Christophe Rahier
Hi Willy,

Many thanks for your help, I'll check our application, I think a lot of
things could be improved :-)

Christophe 


Le 11/09/11 00:12, « Willy Tarreau »  a écrit :

>Hi Christophe,
>
>On Thu, Sep 08, 2011 at 06:54:29AM -0700, Christophe Rahier wrote:
>> Yes ...
>> 
>> Is it possible to improve my config?
>
>Well, your config already allows a server to take as much as 50 seconds
>to respond, and still some requests don't respond within this delay.
>This is really huge and probably nobody will wait that long anyway. It's
>absolutely required to fix the application. You could make use of halog
>to report the slowest URLs :
>
>  halog -ua < log-file | less
>
>The format is a bit raw but you'll get the URLs sorted by average
>response time. Quite often when people encounter 504, it only happens
>on a very small set of URLs, sometimes even only one. Most often this
>is due to poorly written SQL queries which take ages to complete, but
>any number of causes is possible of course.
>
>Regards,
>Willy
>
>
>





Re: Error 504

2011-09-10 Thread Willy Tarreau
Hi Christophe,

On Thu, Sep 08, 2011 at 06:54:29AM -0700, Christophe Rahier wrote:
> Yes ...
> 
> Is it possible to improve my config?

Well, your config already allows a server to take as much as 50 seconds
to respond, and still some requests don't respond within this delay.
This is really huge and probably nobody will wait that long anyway. It's
absolutely required to fix the application. You could make use of halog
to report the slowest URLs :

  halog -ua < log-file | less

The format is a bit raw but you'll get the URLs sorted by average
response time. Quite often when people encounter 504, it only happens
on a very small set of URLs, sometimes even only one. Most often this
is due to poorly written SQL queries which take ages to complete, but
any number of causes is possible of course.

Regards,
Willy




Re: Error 504

2011-09-08 Thread Christophe Rahier
Yes ...

Is it possible to improve my config?



Le 08/09/11 15:50, « Baptiste »  a écrit :

>I can't see anything weird here.
>are the backend status "OK" on the haproxy http stat page?
>
>cheers
>
>On Thu, Sep 8, 2011 at 2:28 PM, Christophe Rahier
> wrote:
>> Hi,
>>
>> Here's my config. Webservers are IIS.
>>
>> global
>> log 192.168.0.2 local0
>> log 127.0.0.1 local1 notice
>> maxconn 10240
>> defaults
>> logglobal
>> option dontlognull
>> retries2
>> clitimeout  5
>> srvtimeout  5
>> contimeout  5
>> timeout server 60s
>>
>> listen WebPlayer-Farm 192.168.0.2:80
>> mode http
>> option httplog
>> balance source
>> #balance leastconn
>> option forwardfor
>> stats enable
>> option http-server-close
>> server Player1 192.168.0.10:80 check
>> server Player2 192.168.0.11:80 check
>> server Player3 192.168.0.12:80 check
>> server Player4 192.168.0.13:80 check
>>
>> listen WebPlayer-Farm-SSL 192.168.0.2:443
>> mode tcp
>> option ssl-hello-chk
>> balance source
>> server Player1 192.168.0.10:443 check
>> server Player2 192.168.0.11:443 check
>> server Player3 192.168.0.12:443 check
>> server Player4 192.168.0.13:443 check
>>
>> listen  Manager-Farm192.168.0.2:81
>> mode http
>> option httplog
>> balance source
>> option forwardfor
>> stats enable
>> option http-server-close
>> server  Manager1 192.168.0.60:80 check
>> server  Manager2 192.168.0.61:80 check
>>
>> listen Manager-Farm-SSL 192.168.0.2:444
>> mode tcp
>> option ssl-hello-chk
>> balance source
>> server Manager1 192.168.0.60:443 check
>> server Manager2 192.168.0.61:443 check
>>
>> listen  info 192.168.0.2:90
>> mode http
>> balance source
>> stats uri /
>>
>>
>>
>> Thanks for your help!
>>
>> Christophe
>>
>>
>>
>>
>> Le 08/09/11 14:16, « Baptiste »  a écrit :
>>
>>>Hello,
>>>
>>>you server might be very slow or your server timeout in your conf
>>>might be too low.
>>>
>>>If you can copy/paste your conf and tell us which version you're using
>>>and the underlying OS.
>>>
>>>cheers
>>>
>>>
>>>On Thu, Sep 8, 2011 at 1:35 PM, Christophe Rahier
>>> wrote:
 Hi,
 I've a question about this error :

 504 Gateway Time-out

 The server didn't respond in time.

 What could I check in my config ? I created 2 LB with a virtual IP and
all
 request are coming from the firewall to this IP.
 I think it's possible, if needed, I can copy my configuration file.
 Thanks for your help, I'm lost.
 Regards, Christophe
>>>
>>>
>>
>>
>>
>
>





Re: Error 504

2011-09-08 Thread Baptiste
I can't see anything weird here.
are the backend status "OK" on the haproxy http stat page?

cheers

On Thu, Sep 8, 2011 at 2:28 PM, Christophe Rahier
 wrote:
> Hi,
>
> Here's my config. Webservers are IIS.
>
> global
> log 192.168.0.2 local0
> log 127.0.0.1 local1 notice
> maxconn     10240
> defaults
> log    global
> option dontlognull
> retries    2
> clitimeout  5
> srvtimeout  5
> contimeout  5
> timeout server 60s
>
> listen WebPlayer-Farm 192.168.0.2:80
> mode http
> option httplog
> balance source
> #balance leastconn
> option forwardfor
> stats enable
> option http-server-close
> server Player1 192.168.0.10:80 check
> server Player2 192.168.0.11:80 check
> server Player3 192.168.0.12:80 check
> server Player4 192.168.0.13:80 check
>
> listen WebPlayer-Farm-SSL 192.168.0.2:443
> mode tcp
> option ssl-hello-chk
> balance source
> server Player1 192.168.0.10:443 check
> server Player2 192.168.0.11:443 check
> server Player3 192.168.0.12:443 check
> server Player4 192.168.0.13:443 check
>
> listen  Manager-Farm    192.168.0.2:81
> mode http
> option httplog
> balance source
> option forwardfor
> stats enable
> option http-server-close
> server  Manager1 192.168.0.60:80 check
> server  Manager2 192.168.0.61:80 check
>
> listen Manager-Farm-SSL 192.168.0.2:444
> mode tcp
> option ssl-hello-chk
> balance source
> server Manager1 192.168.0.60:443 check
> server Manager2 192.168.0.61:443 check
>
> listen  info 192.168.0.2:90
> mode http
> balance source
> stats uri /
>
>
>
> Thanks for your help!
>
> Christophe
>
>
>
>
> Le 08/09/11 14:16, « Baptiste »  a écrit :
>
>>Hello,
>>
>>you server might be very slow or your server timeout in your conf
>>might be too low.
>>
>>If you can copy/paste your conf and tell us which version you're using
>>and the underlying OS.
>>
>>cheers
>>
>>
>>On Thu, Sep 8, 2011 at 1:35 PM, Christophe Rahier
>> wrote:
>>> Hi,
>>> I've a question about this error :
>>>
>>> 504 Gateway Time-out
>>>
>>> The server didn't respond in time.
>>>
>>> What could I check in my config ? I created 2 LB with a virtual IP and
>>>all
>>> request are coming from the firewall to this IP.
>>> I think it's possible, if needed, I can copy my configuration file.
>>> Thanks for your help, I'm lost.
>>> Regards, Christophe
>>
>>
>
>
>



Re: Error 504

2011-09-08 Thread Christophe Rahier
Hi,

Here's my config. Webservers are IIS.

global
log 192.168.0.2 local0
log 127.0.0.1 local1 notice
maxconn 10240
defaults
logglobal
option dontlognull
retries2
clitimeout  5
srvtimeout  5
contimeout  5
timeout server 60s

listen WebPlayer-Farm 192.168.0.2:80
mode http
option httplog
balance source
#balance leastconn
option forwardfor
stats enable
option http-server-close
server Player1 192.168.0.10:80 check
server Player2 192.168.0.11:80 check
server Player3 192.168.0.12:80 check
server Player4 192.168.0.13:80 check

listen WebPlayer-Farm-SSL 192.168.0.2:443
mode tcp
option ssl-hello-chk
balance source
server Player1 192.168.0.10:443 check
server Player2 192.168.0.11:443 check
server Player3 192.168.0.12:443 check
server Player4 192.168.0.13:443 check

listen  Manager-Farm192.168.0.2:81
mode http
option httplog
balance source
option forwardfor
stats enable
option http-server-close
server  Manager1 192.168.0.60:80 check
server  Manager2 192.168.0.61:80 check

listen Manager-Farm-SSL 192.168.0.2:444
mode tcp
option ssl-hello-chk
balance source
server Manager1 192.168.0.60:443 check
server Manager2 192.168.0.61:443 check

listen  info 192.168.0.2:90
mode http
balance source
stats uri /



Thanks for your help!

Christophe




Le 08/09/11 14:16, « Baptiste »  a écrit :

>Hello,
>
>you server might be very slow or your server timeout in your conf
>might be too low.
>
>If you can copy/paste your conf and tell us which version you're using
>and the underlying OS.
>
>cheers
>
>
>On Thu, Sep 8, 2011 at 1:35 PM, Christophe Rahier
> wrote:
>> Hi,
>> I've a question about this error :
>>
>> 504 Gateway Time-out
>>
>> The server didn't respond in time.
>>
>> What could I check in my config ? I created 2 LB with a virtual IP and
>>all
>> request are coming from the firewall to this IP.
>> I think it's possible, if needed, I can copy my configuration file.
>> Thanks for your help, I'm lost.
>> Regards, Christophe
>
>





Re: Error 504

2011-09-08 Thread Baptiste
Hello,

you server might be very slow or your server timeout in your conf
might be too low.

If you can copy/paste your conf and tell us which version you're using
and the underlying OS.

cheers


On Thu, Sep 8, 2011 at 1:35 PM, Christophe Rahier
 wrote:
> Hi,
> I've a question about this error :
>
> 504 Gateway Time-out
>
> The server didn't respond in time.
>
> What could I check in my config ? I created 2 LB with a virtual IP and all
> request are coming from the firewall to this IP.
> I think it's possible, if needed, I can copy my configuration file.
> Thanks for your help, I'm lost.
> Regards, Christophe



Re: [Error] 504 GateWay Timeout : timeout server

2009-08-14 Thread Willy Tarreau
Hi Robbie,

On Fri, Aug 14, 2009 at 10:37:29AM +0200, Robbie Aelter wrote:
> Hi Willy,
> 
> sorry it was my mistake, i checked this morning and saw i made a mistake 
> in the listen backend, since there are over 50.

no problem. Thanks for the feedback !
Willy




Re: [Error] 504 GateWay Timeout : timeout server

2009-08-14 Thread Robbie Aelter

Hi Willy,

sorry it was my mistake, i checked this morning and saw i made a mistake 
in the listen backend, since there are over 50.


kind regards,

Robbie

On 13/08/09 22:41, Willy Tarreau wrote:

On Thu, Aug 13, 2009 at 01:13:24PM +0200, Robbie Aelter wrote:
   

Hi,

we seem to get 504 errors.  I have found the solution, we just increase
the timeout server variable to a higher value.
But the problem seems to be that I can't seem to do it per listen
instance and have a general timeout server configured in the defaults
section.

defaults ...
 timeout server 60s
 ...

listen ...
 timeout server 1200s
 ...

The defaults seems to get the upperhand. Did I do something wrong or
does the default overwrite the one in the listen section?
 

No, you're proceeding the right way. Are you really sure about
your observations ? What do you see in the logs for timeouted
connections ?

Willy

   



--

Robbie Aelter
System/Network Engineer

NETLOG NV
Emile Braunplein 18
B-9000 Gent
http://corporate.netlog.com/
Tel  +32 2 400 43 21
Fax +32 2 400 43 20

rob...@netlog.com
http://netlog.com/robbieaelter




Re: [Error] 504 GateWay Timeout : timeout server

2009-08-13 Thread Willy Tarreau
On Thu, Aug 13, 2009 at 01:13:24PM +0200, Robbie Aelter wrote:
> Hi,
> 
> we seem to get 504 errors.  I have found the solution, we just increase 
> the timeout server variable to a higher value.
> But the problem seems to be that I can't seem to do it per listen 
> instance and have a general timeout server configured in the defaults 
> section.
> 
> defaults ...
> timeout server 60s
> ...
> 
> listen ...
> timeout server 1200s
> ...
> 
> The defaults seems to get the upperhand. Did I do something wrong or 
> does the default overwrite the one in the listen section?

No, you're proceeding the right way. Are you really sure about
your observations ? What do you see in the logs for timeouted
connections ?

Willy