Re: redirections using http 302 / other way?

From: florian iragne <florian.iragne#viewsurf.com>
Date: Tue, 22 Jan 2008 08:08:13 +0100


Willy Tarreau a écrit :
> Hello Florian,
>
> On Mon, Jan 21, 2008 at 08:39:53AM +0100, florian iragne wrote:
>
>> Hello everybody,
>>
>> I'm trying to move from pound to haproxy and currently, there is one
>> last thing that i can't move. I'm using Pound to redirect clients to
>> serveral servers using http 302 code (load balancing is done with round
>> robin), so that the chosen server directly replies to the client,
>> avoiding the response through the server hosting Pound. This is
>> necessary to maximize the bandwidth.
>>
>
> Well, do you need *that* much bandwidth ?
>

well, yes, and no. My servers have 1Gbps NIC, and i can't have more bandwith per server (the ISP does not provide servers with 10Gbps NIC), and believe me, i need much more than 1GBps for the service.
>> With Haproxy, i see that 302errorloc is available, but not for this
>> purpose. So my question is : is there a way, in Haproxy, to do the same
>> (or similar) redirection than the one i currently make with Pound?
>>
>
> Not yet. I've already noted this in my (low priority) todo list
> because one user once asked me about multi-site load balancing
> with small uplinks. I figured out that this method combined with
> cookie-based persistence could very well fit those needs.
>
> However you must keep in mind that it is dangerous. For instance,
> a POST request redirected using a 302 would result in a POST to
> the new URI, with without the data. If a user is about to upload
> an attachment in a webmail just before the server or access collapses
> and a 302 is returned to another server, depending on the application,
> the user may post an empty attachment without being aware of it, for
> instance.
>

Y'es, i'm aware of this problem. However, for my purposes (delivering static but heavy content), it is irrelevant.
> Anyway, I don't think it's too hard to implement. We should add
> another server option indicating that this server should result
> in a 302 (or 303) with the URI returned in the Location: field.
> All basic checking methods would still be there. I think that
> this is not much complicated.

Well It would be great to have such a feature, to definitely replace Pound in our architecture (it becomes overloaded with the number of requests when haproxy seems to have the time to take a coffee while doing is job).

Haproxy is a great software, thanks a lot for your work (and your answer)

Florian Received on 2008/01/22 08:08

This archive was generated by hypermail 2.2.0 : 2008/01/22 08:15 CET