Hello Christopher, William, Willy, et all!

Matt McDonagh reported a regression on discourse [1] in 1.7.6, that
causes haproxy to ignore "timeout http-keep-alive" when going through
filters (aka compression is enabled) and also causes logging to be
delayed.

Because timeouts are ignored and wrong timeouts strike, performance
issues are likely (as we don't close idle sessions as expected, we hit
maxconn sooner, etc).

The root cause are actually 2 different patches in 1.7 stable. This is
getting a bit complex here, because in 1.7 both patches cause
regressions, while in 1.8 only one of those 2 patches actually cause an
issue.


We are talking about:
2b553de BUG/MINOR: filters: Don't force the stream's wakeup when we wait in 
flt_end_analyze
c0c672a BUG/MINOR: http: Fix conditions to clean up a txn and to handle the 
next request


Repro config (I used netcat for a HTTP/1.1 request):

global
 maxconn 100
 log 10.0.0.4 syslog debug
defaults
 log global
 mode http
 option httplog
 option http-server-close
 #option http-keep-alive
 timeout connect 5s
 timeout client 10s
 timeout server 20s
 timeout http-keep-alive 1s
frontend myfrontend
 bind :80
 default_backend mybackend
backend mybackend
 compression algo gzip
 server www www.lan.ltri.eu:80


In v1.7.4 (everything fine):
"mode http-server-close":
  as expected (logs immediately, closes idle keep-alive at
  "timeout http-keep-alive")

"mode http-keep-alive":
  as expected (logs immediately, closes idle keep-alive at
  "timeout http-keep-alive")


In v1.7.5 (due to b0c3fd3b BUG/MINOR: filters: Don't force the stream's wakeup 
when we wait in flt_end_analyze):
"mode http-server-close":
  log stalled and keep-alive idle close at "timeout connect";
  ignores "timeout http-keep-alive"

"mode http-keep-alive":
  log stalled and keep-alive idle close at "timeout connect + client";
  ignores "timeout http-keep-alive"


In v1.7.6 (due to 73d071e BUG/MINOR: http: Fix conditions to clean up a txn and 
to handle the next request):
"mode http-server-close":
  log stalled and keep-alive idle close at "timeout client";
  ignores "timeout http-keep-alive"

"mode http-keep-alive":
  log stalled for "timeout server"; keep-alive stalled for
  "timeout server (then log) + timeout http-keep-alive"



As for 1.8:
Patches have been applied as per Author-Date, while in 1.7 the
patches have been applied in reverse order.

"BUG/MINOR: http: Fix conditions to clean up a txn and to handle the next 
request"
 -> does not cause issues in 1.8

"BUG/MINOR: filters: Don't force the stream's wakeup when we wait in 
flt_end_analyze"
 -> has the same effect as in 1.7(.6).


The 1.6/1.5 situation is unkown at this time.


Let me know if something is unclear (I'm almost certain it is) ...



cheers,
lukas


[1] http://discourse.haproxy.org/t/keep-alive-behaviour-change-since-1-7-6/1390


Reply via email to