2 Replies Latest reply on May 5, 2005 10:31 AM by smarlow

    Tomcat performance change to reduce concurrency...

    smarlow

      Hi,

      I wonder if anyone has any feedback on a performance change that I am working on making.

      One benefit of reducing concurrency in a server application is that a small number of requests can complete more quickly than if they had to compete against a large number of running threads for object locks (Java or externally in a database).

      I modified the Tomcat Thread.run code to use Doug Lea's semaphore support but didn't expose a configuration option (haven't learned how to do that yet). My basic change is to allow users to specify the max number of concurrent servlet requests that can run. If an application has a high level of concurrency, end users may get more consistent response time with this change. If an application has a low level of concurrency, my change doesn't help as their application only has a few threads running concurrently anyway.

      This also reduces resource use on other tiers. For example, if you are supporting 500 users with a Tomcat instance, you don't need a database connection pool size of 500, instead set the throttle size to 20 and create a database connection pool size of 20.

      Current status of the change:

      1. org.apache.tomcat.util.threads.ThreadPool.CONCURRENT_THREADS is hardcoded to a value of 18, should be a configurable option.
      2. I hacked the build scripts to include Doug Lea's concurrent.jar but probably didn't make these changes correctly.

      -Scott

        • 1. Re: Tomcat performance change to reduce concurrency...
          starksm64

          Discussion of changes to the core of tomcat should be happening on the tomcat dev list, not here. It would only be revelvant here if they told you to get lost and wanted to pursue a jboss specific integration.

          • 2. Re: Tomcat performance change to reduce concurrency...
            smarlow

            I moved the discussion to the Tomcat dev list as suggested. The initial response that I got was that the enhancement wasn't needed. I need to figure out if they are correct and if so how to configure Tomcat 5.5 to reduce concurrency. If I'm correct, I'll need to explain better the idea of reducing concurrency and how it can be done in Tomcat. I'll also need to submit benchmark results showing the improvement.

            I hope that I am wrong as that would mean better performance can be obtained with the current Tomcat 5.5 release now :-)

            -Scott