Hi in tomcat6 server.xml I have one connector for catalina service. And I set maxThreads=5:

  <Service name="Catalina">
        <Connector port="8090" maxThreads="5" protocol="HTTP/1.1" />

But after restarting tomcat I can see more then 5 threads created. Why is maxThreads property ignored?

  • how are you testing for maxthread > 5 ? Is it more than 5 concurrent requests you can see? – JoseK Dec 14 '10 at 7:01
  • I'm running htop and I can see about 25-35 tomcat java threads running – tefozi Dec 14 '10 at 8:09
  • 1
    AFAIK, the maxthreads does not control the number of child processes forked by Tomcat. It only controls the number of concurrent requests which Tomcat can handle. – shinynewbike Dec 14 '10 at 10:17
  • Excerpt from the docs: "...If an executor is associated with this connector, this attribute is ignored as the connector will execute tasks using the executor rather than an internal thread pool." Do you have an executor configured? – Milen A. Radev Dec 14 '10 at 15:35
  • No I don't have executor. – tefozi Dec 15 '10 at 16:01

You have defined the http worker threads. Tomcat also needs some more like timer, ajp, jmx etc. You can control your existing threads for example with JVisualVM, bundeled with Oracles JVM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.