Hi John, On Wed, May 28, 2014 at 07:54:20PM +0000, JDzialo John wrote: > Hi Willy > > Thanks, I'll send future traces to you directly. I understand the hatred of > bulky email files! > > So I think I found the problem but would love your take on it. > > Our web applications and services in our haproxy backend are using keepalive > in their connection headers. I understand in haproxy v1.4 keepalives are ok > from the client side but not from the server side, correct? > > So I added the option to http-server-close on our haproxy web service server > and it appears to have stopped this random half loaded data stream issue. > > Can you explain how having keepalive coming from the server side application > connection headers could cause this issue? > > Could you give a brief description of what happens when haproxy receives a > keepalive header but does not have http-server-close option set?
OK so the client is not a browser, right ? When you're using "option httpclose" only, haproxy just modifies the headers to add "close" to the request and to the response, but does not perform any active close. I observed in the distant past (8 years ago) that some servers would not honnor the "close" and would expect the client to close after they get the complete response. Then I added "option forceclose" to close the server-side connection once the server starts to respond. By now we have a much more complete message parser which knows where the end is and which actively closes the connections as soon as you enable http-server-close or http-keep-alive (which is not available on 1.4). So what you found now is that your server ignores the "close" and expects the client to close, while the client expects the same from the server. Additionally it's possible that your client uses excess buffering and does not get the whole response until it gets the real close (possibly the one caused by haproxy's timeout). Usually these situations are detectable in haproxy's logs because you get very large total transfer times for a small server response time, and you notice that all transfer times are very close to the client or server timeout. Then you know that the connection remained open for that amount of time. Anyway, please use http-server-close or forceclose, it will do what you need by enforcing the close. I hope you get a clearer picture now. Regards, Willy

