Hi Piotr, On Fri, Jan 22, 2016 at 12:18:15PM +0100, Piotr Rybicki wrote: > >>I've recently discovered odd behaviour regarding keep-alives in haproxy > >>and sites with HTML5/js/ajax ultra-fancy stuff. Some (random) requests > >>are not loaded (like images). Disabling keep-alive in haproxy solves > >>this issue. 'Normal' sites seems to be working fine with keepalives on. > >> > >>Is there anyone, experiencing the same issue? > > > >I'm not aware of any such report. Does it happen a lot or just once in > >a while ? > > Only when site uses JS/HTML5 stuff. Issue is reproducible.
OK. > >>I believe - timeouts should be the same, although timeouted keep-alive > >>conn should be reconnected transparently. > > > >The client automatically retries a failed request over a keep-alive > >connection, that's mandated by the spec since nobody can predict when > >the middle will close, and that due to network latency, both the client > >and the server may decide to close at the same time and each of them > >will receive the other one's notification after their action. > > > >>I recall someone probably reported similar issue, but can't find that in > >>archives. > > > >I don't have this in mind. We had many issues during 1.5-dev and these > >versions were used a lot in production due to SSL, so maybe it was one of > >them. > > Found it. Seems like this issue: > > http://www.serverphorums.com/read.php?10,1341691 I find this one to be very different, it's about server timeouts not being forwarded to the client. This only happens when the request has already failed. In your case since it works without keep-alive it has nothing to do with this. > >>haproxy 1.5.15, linux 3.18.24 > > > >Have you checked if this happens more (or only) with a specific browser ? > >Have you tried to increase the keep-alive timeout to insane values just > >for a test (ie: at least the test session's duration) ? Also, could you > >check if you're seeing it more in HTTP or HTTPS ? > > Tried FireFox and IE - the same. HTTP/HTTPS doesn't make any difference. OK. > I have theory, that JS code actually makes this problematic > requests/responses (not 'plain' browser itself). So it could be related to XMLHttpRequests maybe ? > Disabling keep-alive solves this problem. By the way when you disable keep-alive, where and how do you disable it ? Do you do it on the server, or do you turn haproxy to http-server-close, or to forceclose ? The differences are important. We could for example imagine a bug where a websocket request made on a connection which served as HTTP just before would randomly break for whatever reason. That's just an example, of course. Regards, Willy

