Hi everyone,

Thanks for developing tomcat, and kudos for having comprehensive JMX
instrumentation for the server. I think its the best out of the box
instrumentation one could ask for, for doing performance modeling and
application monitoring.

I was a bit surprised when I tried out the Semaphore Valve and would like
to get feedback on what others think.

I noticed that the valve limits requests per second, based on the
'concurrency' configuration for the valve. However, I am not sure if this
implementation is ideal, and the meaning of concurrency for Tomcat needs to
be considered differently. My assertion is based on my prior work on
performance modeling of Tomcat with Dr. Neil Gunther (
http://www.perfdynamics.com/Bio/njg.html).

In queuing theory, Little’s Law expresses the relation between the average
queue length, residence time and arrival rate. The average queue length can
also be considered as the load in the system or the concurrency. In case of
Tomcat, Little’s Law can be observed for the threads in service stage,
requests per second and response time as:
N = X * R,
where N is concurrency or the threads in service stage,
X is requests per second and R is the response time.

The concurrency of tomcat then, is the number of threads which are actively
serving requests. With the Semaphore Valve enabled (at the host level),
however, I saw the requests per second being constant at the concurrency
setting of the valve and number of service threads changing with a
consistent jagged pattern of peaks. For eg, on a test host with the valve’s
concurrency setting of 50 rps, the threads in service state went up to 700
and this formed a jagged pattern of peaks at 700 threads at regular
intervals, unlike normal operation of Tomcat, where the number of service
threads usually has a smoother pattern.

What do you guys think ?

Here’s a post I authored on Dr. Gunther’s blog on modeling Tomcat’s
performance
* http://perfdynamics.blogspot.de/2016/08/pdq-as-performance-
periscope_3.html

Note - the conclusion in the post needs revision, but the relations between
key metrics discussed are valid.

Thanks,
Mohit

Reply via email to