[core] proxy,scgi omit shutdown() to backend (fixes #2743)
Due to the POLLHUP behavior triggered on *BSD/Darwin, the shutdown() had previously been limited to local connections. If interested in squeezing the last bits of performance out of a machine, an admin should configure local connections to be AF_UNIX instead of AF_INET or AF_INET6 to localhost. The reason the shutdown() was originally added in mod_proxy and mod_scgi was to aggressively reduce the number of potential sockets in TIME_WAIT held by lighttpd. (See commit:923688d2 "drain backend socket/pipe bufs upon FDEVENT_HUP", done for reliability given the aforementioned *BSD/Darwin behavior.) When using AF_UNIX, the TIME_WAIT issue does not exist, ergo, the recommendation is to use AF_UNIX for local sockets, when available. Using AF_UNIX sockets is a better solution to eliminate TIME_WAIT than is TCP shutdown() half-close which, as we have seen, might not be handled well by frameworks which are more complex than basic read request, send response, and close. x-ref: "1.4.40/41 mod_proxy, mod_scgi may trigger POLLHUP on *BSD,Darwin" https://redmine.lighttpd.net/issues/2743personal/stbuehler/mod-csrf-old
parent
7e2090b96b
commit
27f85dbdf4
Loading…
Reference in New Issue