3 ms·
More importantly, the TIME_WAIT state only happens for the socket that initiated the close (active close). In the case of a HTTP keep-alive, the active close is
by paraboul 12y ago
More importantly, the TIME_WAIT state only happens for the socket that initiated the close (active close). In the case of a HTTP keep-alive, the active close is usually done by the client instead of the server (avoiding a TIME_WAIT on the server side).
A general rule when designing a network protocol : do your best to make the client-side closes the connection when possible.
- joosters 12y agoVery true. Note that the web page discusses load balancers in a few places. If you have such a setup, the LB is effectively acting as a client and so the TIME_WAITs will still pile up on one of your machines. If the load balancer can re-use the HTTP connections from LB<->web server with keepalives, then it will reduce them.