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

On Thu, Aug 2, 2012 at 3:46 PM, Baptiste <[email protected]> wrote:

> On Wed, Aug 1, 2012 at 1:13 PM, mark green <[email protected]>
> wrote:
> > Hi,
> >
> >    when haproxy forward a http request to server, and received response
> from
> > backend server,
> > forward it to client, will haproxy receive another request on the same
> > socket before this response is forwarded to client?
> > and, how to decide this response is completely forwarded to client?
> >
> > Thanks
>
> Hi Mark,
>
> It depends on the options you have enabled on HAProxy, and in some
> cases, on the server itself.
> The options I'll speak about are "http-server-close" and "httpclose".
> If none of them are set in your configuration, then you're in the
> tunnel mode, which means HAProxy will analyze the first request then
> maintain opened a tunnel between the client and the server, where
> every data being transferred won't be analyzed.
> In this mode, this is up to the server to decide when to close the
> connection.
>
> If you setup httpclose, then HAProxy will close the TCP connection
> after each request for both client and server, announcing the HTTP
> header "Connection: close".
>
> If you setup http-server-close, then HAProxy will use HTTP keep alive
> to maintain the TCP connection opened on the client side only. On the
> server side, a new TCP connection will be opened per each HTTP
> requests.
>
> I don't understand your last question.
> Could you be clearer?
>
> Baptiste
>

Reply via email to