Hello Zefferno,

On Thu, Jul 23, 2020 at 06:30:47PM +0300, Zefferno wrote:
> GET /demo HTTP/1.1
> Host: <hostname>
> User-Agent: curl/<ver>
              ^^^^
(...)
> As can be seen in the last packet, HAproxy immediately closes the
> connection with [RST, ACK] after sending [ACK], and I'm expecting it to
> keep the connection alive for a few seconds.
> 
> Is it normal behaviour?

I suspect you're sending a single request with curl and closing the client
connection. In 1.8, the backend connection was associated with a client
connection. So if you send a single request then close the client side,
haproxy couldn't keep the connection open as it had nowhere to attach it.
This changed in 1.9 with the introduction of server pools, which became
used by default in 2.0. Note however that even in 2.0 connections could
only be shared among the same thread. It's only the recently released 2.2
that permits to share idle connections between threads. In this case you
could really connect multiple times with curl and see the server-side
connection being reused (provided you use "http-reuse always", as the
default is "safe", which consists in not taking risks for the first
request of a connection).

Regards,
Willy

Reply via email to