title: Tomcat, service unavailable 503
body: <p>My webapp uses JSP / JavaScript/ google visualization, and runs on Tomcat 7 on a 64bit windows server with enough resources dedicated to this app.It is still under testing, so, I have control over the load.</p>
  
  <p>The problem is when I work from device at same network of the server, everything works fine. But when I work from device from different network with a request took a long time (more than 6 minutes) I get Service Unavailable [503] message after 6 minutes of waiting while processing in the server is going on and completed successfully. I checked the Tomcat logs but i couldn't find any thing every thing seems to be work fine. I tried different solutions but non of them worked with me:</p>
  
  <ul>
  <li>Increase Tomcat's connector timeout.</li>
  <li>Increase the Tomcat RAM.</li>
  <li>Disable the server firewall</li>
  <li>Try different browsers</li>
  <li>Adjust the request timeout from the browser.</li>
  </ul>
  
  <p>I experimented by setting Tomcat's Connector properties in conf/server.xml. I played around with all combinations and ranges of connectionTimeout and keepAliveTimeout.</p>
  
  <p>The final configuration is:</p>
  
  <pre><code> &lt;Connector port="80" protocol="HTTP/1.1"
            address="0.0.0.0"
            connectionTimeout="3600000"
            redirectPort="8443" /&gt;
  </code></pre>
  
  <p>I'm wondering if anybody else has run into such a problem, and how they solved it.</p>