title: What determines number of simultaneous connections
body: <p>In a Java servlet environment, what are the factors that are the bottleneck for number of simultaneous users. </p>
  
  <ol>
  <li>Number of HTTP connections the server can allow per port</li>
  <li>Number of HTTP connections the server can allow across several ports (I can have multiple WAS profiles on several HTTP ports)</li>
  <li>Number of servlets in pool </li>
  <li>Number of threads configured for WAS to use to service connections</li>
  <li>RAM available to server (is there any any correletation between number of service threads assuming 0-memory leak in application)</li>
  </ol>
  
  <p>Are there any other factors?</p>
  
  <p>Edited:
  To leave business logic out of the picture, assume have only one servlet printing one line on Log4j.</p>
  
  <ul>
  <li>Can my Tomcat server handle 6000 simultaneous HTTP connections? Why
  not (file handles? CPU time per request?)?</li>
  <li>Can I have thread pool size as 5000 (do idle threads cost CPU/RAM)?</li>
  <li>Can I have oracle connection pool size as 500 connections (do idle
  connections cost CPU/RAM)?</li>
  </ul>
  
  <p>Is the amount of garbage that is generated for each connection have an impact? For example, if for each HTTP connection 20KB of objects are created and left behind by Tomcat.. then by the time 2500 requests are processed 100MB heap would be used and this may trigger a GC pause of 300ms.</p>
  
  <p>Can we say something like this: if Tomcat uses 0.2 sec of CPU time for processing a single HTTP request, then it would be able to handle roughly 500 http connections in a second. So, 6000 connections would need 5 seconds.</p>