Hello, On 07/21/2016 08:33 PM, CJ Ess wrote: > I think I'm overlooking something simple, could someone spot check me? > > What I want to do is to pool connections on my http backend - keep > HAProxy from opening a new connection to the same backend if there is an > established connection that is idle. > > My haproxy version is 1.5.18 > > In my defaults section I have: > > timeout http-request 5s > timeout http-keep-alive 75s > > In my backend definition I have: > > mode http > option http-keep-alive > balance roundrobin > > What I see in the packet capture is: > > The client makes an http/1.1 request w/ no Connection header (haproxy > -> backend) > The server gives an an http/1.1 response with content-length and no > connection header (backend -> haproxy) > 5s later Haproxy closes the connection > > There is more then enough traffic going through the backend that if a > connection is idle, there will be a request that could use it (within > ms, should never hit the 5s or 75s timeouts), however in every case the > connection just sites idle for five seconds then closes. > > Am I missing something simple to enable this behavior? >
The 'option http-keep-alive' works only per-session, which means only the client that initiated the connection can reuse an existing connection for another request. What you are looking for is available in 1.6 and is called http-reuse. The docs are very clear, so check them out: https://cbonte.github.io/haproxy-dconv/configuration-1.6.html#4-http-reuse Regards, Nenad

