Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i am building an adserver. In tests i see lots of TIME_WAIT state due to the use of an in memory db redis.

Forums suggested lowering the time wait value from registry.

Any down sides ?

share|improve this question

The purpose of the TIME_WAIT state is to facilitate reliable connection tear-down. Reliable connection tear-down in turn protects future connections from previous connection termination segments (FIN segments). So by lowering the "time_wait value" (more accurately the maximum segment lifetime, see below) you risk active TCP connections being terminated inadvertently.

Why is that so? For a reliable connection tear-down, TCP has to exchange three messages analogous to the three-way handsake. The actively closing end stays in the TIME_WAIT for twice the maximum segment lifetime (MSL) after sending the final tear-down acknowledgement (ACK). This is because your final ACK could have been lost in which case the remote end would timeout, resend the FIN segment and watis again for that final ACK from the local end. If you lower the MSL value, it becomes more likely that the socket-pair is reused soon, when there is still a FIN segment from the remote end in the network. Such a segment can subsequently be mistaken for a request to terminate the new connection.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .