title: Setting TIME_WAIT TCP
body: <p>We're trying to tune an application that accepts messages via TCP and also uses TCP for some of its internal messaging.  While load testing, we noticed that response time degrades significantly (and then stops altogether) as more simultaneous requests are made to the system.  During this time,  we see a lot of TCP connections in <code>TIME_WAIT</code> status and someone suggested lowering the <code>TIME_WAIT</code> environment variable from it's default 60 seconds to 30.</p>
  
  <p>From <a href="http://www.developerweb.net/forum/showthread.php?t=2941" rel="noreferrer">what I understand</a>, the <code>TIME_WAIT</code> setting essentially sets the time a TCP resource is made available to the system again after the connection is closed.</p>
  
  <p>I'm not a "network guy" and know very little about these things.  I need a lot of what's in that linked post, but "dumbed down" a little.</p>
  
  <ul>
  <li>I think I understand why the <code>TIME_WAIT</code> value can't be set to 0, but can it safely be set to 5?  What about 10?  What determines a "safe" setting for this value?</li>
  <li>Why is the default for this value 60?  I'm guessing that people a lot smarter than me had good reason for selecting this as a reasonable default.</li>
  <li>What else should I know about the potential risks and benefits of overriding this value?</li>
  </ul>