Re: Stats page wobbly

From: Willy Tarreau <w#1wt.eu>
Date: Sat, 14 Jun 2008 00:11:38 +0200


On Fri, Jun 13, 2008 at 11:55:24PM +0200, Alexander Staubo wrote:
> On Fri, Jun 13, 2008 at 8:40 PM, Willy Tarreau <w#1wt.eu> wrote:
> > BTW, for your stats problem, it is because there is no "option httpclose"
> > in your configuration. Haproxy does not support keep-alive, so when you
> > first click on the site then enter the stats URL, then your browser reuses
> > the same session and haproxy does not get the request. Adding "option
> > httpclose" solves this problem (I should add a FAQ).
>
> Follow-up question: It would be great if HAProxy could use HTTP
> keep-alive for some backends that never/rarely go down or are
> restarted and where it's fine for the next request to go to the same
> backend -- essentially everything except Rails. I suspect that the
> only way to achieve this is to two separate frontend declarations on
> different IP/ports -- correct?

not necessarily, because the "option httpclose" option is considered either in the backend or in the frontend. So you could very well have one backend with it (for rails) and another one without it (eg for statics), and use an ACL in the frontend to determine which backend will process the connection (note: I'm talking about connection and not request). If you send it to the backend without the option above, the connection will be maintained, but further contents will not be analyzed anymore. While dangerous, it might work when matching on hostnames, source IPs or user-agents, eg: anything which should not change along a connection.

But to be honnest, I would not recommend doing this, it would be a nightmare to debug. If you can bind to multiple IPs, it'll be easier!

Regards,
Willy Received on 2008/06/14 00:11

This archive was generated by hypermail 2.2.0 : 2008/06/14 00:17 CEST