title: Grails + Tomcat + Ubuntu problem: CLOSE_WAIT connections
body: <p>I have encountered a really bizarre stability problem in production when running a trivial Grails application using standard components.</p>
  
  <p>After some time of normal operation the number of Tomcat (<code>jsvc</code>) TCP connections in state <code>CLOSE_WAIT</code> increases until Tomcat hits its thread ceiling (<code>Maximum number of threads (N) created for connector</code>), after which Tomcat grinds to a halt.</p>
  
  <p>Normally this would indicate that the application contains code that does not properly close its TCP connections. However, my Grails code in this application is really really trival and does not initiate any TCP connections on its own, so I can't think of any scenario where my code could cause the <code>CLOSE_WAIT</code> problem.</p>
  
  <p>Furthermore, all the components in the stack are all standard stuff that I'd assume to be bug free; I'm running Grails 1.2.1 under the standard Tomcat 6 that comes bundled in Ubuntu 9.1 (<code>apt-get install tomcat6</code>).</p>
  
  <ul>
  <li>Is this a known problem?</li>
  <li>How would you go about trouble-shooting it?</li>
  </ul>