Re: Problems with 408 timeouts

From: Willy Tarreau <w#1wt.eu>
Date: Mon, 5 Sep 2011 22:14:08 +0200


Hi Florian,

On Mon, Sep 05, 2011 at 02:56:15PM +0200, Florian Munz wrote:
> Hello,
>
> we started rolling out haproxy to production last week and everything
> seems to be working fine, except a few users are reporting seeing the
> "408 Request Time-out" error page.
>
> I didn't manage to reproduce it yet, it mostly seems to be users on
> other continents.
>
> My main problem is that these 408 don't show up in the haproxy log. Is
> that normal?

No, you should definitely have them in your logs. Do you have other logs ?

> Or are they reported with a different status code and a
> common termination flag?

The termination flags will generally be "cR" (client timeout during Request).

> My timeouts are set like this:
>
> timeout client 45s
> timeout server 45s
> timeout connect 5s
> timeout queue 10s
> timeout check 2s
> timeout http-request 5s
> timeout http-keep-alive 1s

You should probably increase your http-request timeout if users are experiencing issues. 5s allows for one TCP retransmit (3s) and 2 extra seconds. Considering that some slow links (satellite, GPRS) already exhibit several hundreds of ms of RTT, You're very likely shooting the connection too fast from time to time.

I suggest that you increase it to 10s first. Similarly, it may be worth increasing your keep-alive timeout (eg: 5-10s).

Last, though irrelevant to this issue, your queue timeout should probably match your server timeout. The reason is that if you set the server timeout that large, it probably is because you expect that a few pages may occasionally be slow. Thus, if an incoming request is waiting for a connection to be released, it makes sense to consider that it might have to wait up to the time it takes for a request to complete. Of course this is not completely true and the average wait time will drop as the max number of server connections increases, but you get the idea.

Regards,
Willy Received on 2011/09/05 22:14

This archive was generated by hypermail 2.2.0 : 2011/09/05 22:30 CEST