Bug #2090
closedmod_proxy_core + mod_proxy_backend_http may leak connections
Description
I tried to use mod_proxy_core + mod_proxy_backend_http link lighttpd with apache.
I killed apache and restart it (both lighttpd and apache were serving at the monent, 500 req/s), and I found lighttpd was not stable. Its cpu usage suddenly raised to a high level for a few seconds or even minutes, then falled to normal level, but after some minutes it raised again, and so on.
I shutdown lighttpd, set proxy-core.debug = 1, and did it angain. This time I found lighttpd kept printing "proxy_state_engine: state=6" in its errorlog and never stopped.
At last, I found an interesting thing. When the httpd backend returns an incomplete response, something like
"HTTP/1.1 200 OK\r\nContent-Length: 100\r\n"(obviously it's not finished yet), without any other headers or content-body, lighttpd would keep printing "proxy_state_engine: state=6". The reason is that the leak connections, caused by irregular response, occupy positions in srv->connections and never relase them. As the number of leak connections increases, lighttpd process's cpu usage can be up to 100%.
I suggest treat the incomplete response, which returned by backend httpd server, as a blank page.
Files
Added by stbuehler over 15 years ago
Also available in: Atom
Mark recv-queue closed if backend connection got closed in mod_proxy_core (fixes #2090, thx liming)