On Thu, Aug 2, 2012 at 10:34 AM, mark green <httpproxy1...@gmail.com> wrote:
> Hi, Baptiste
>
> Thanks for your explanation.
>
> the second question is from this:
> I want to change the current behavior of connection between haproxy and
> backend servers as following:
> pre-setup some persistent connections between haproxy and backend servers.
> such as: connection1(haproxy---->server1), connection2(haproxy--->server2)
> and,
> 1, when a client1's request incoming, dispatch it to connection1 , forward
> the request to server1, and when server1's
> response is totally forwarded to client1 by haproxy, connection1 is freed;
> then if clientN's request incoming,
> dispatch it to connection1. that is reusing the connection.
>
> clinet1----------->[             ]------------------>server1
> client2----------->|             |
> ......                |  haproxy|
> clientn----------->[             ]------------------->server2
>
> so, I should know when the response is totally forwarded so that I can free
> the connection between haproxy and server
>
>
> Mark

Hi,

You can't pre-allocate connection with HAProxy.
and what you're describing is not doable.
Saying that, HAProxy does TCP buffering, it reads responses at server
speed and answers at client speed, releasing the server connection
once all the data have been received (oof course, only if the server
sends data faster than the client can read it).
You hide client side latency on your server. That's why you'll see you
have 300 connections on the frontend and only 10 on the backend (for
exemple), it would mean that your sever latency is in average 10 time
lower than the client one.

If you want to use server 1 only untill it is saturated, there is a
new LB algorithm available: "balance first".

cheers

Reply via email to