]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: checks: avoid accumulating TIME_WAITs during checks
authorWilly Tarreau <w@1wt.eu>
Fri, 23 Nov 2012 08:18:20 +0000 (09:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 Nov 2012 08:18:20 +0000 (09:18 +0100)
commitfd29cc537b8511db6e256529ded625c8e7f856d0
tree83183f64c4684fb78f69adc9e66d59ca4c4f007a
parentef8a719f7070fb5f1cc634dcb64be250a947046f
MEDIUM: checks: avoid accumulating TIME_WAITs during checks

Some checks which do not induce a close from the server accumulate
local TIME_WAIT sockets because they're cleanly shut down. Typically
TCP probes cause this. This is very problematic when there are many
servers, when the checks are fast or when local source ports are rare.

So now we'll disable lingering on the socket instead of sending a
shutdown. Before doing this we try to drain any possibly pending data.
That way we avoid sending an RST when the server has closed first.

This change means that some servers will see more RSTs, but this is
needed to avoid local source port starvation.
src/checks.c