Logging Information when Tomcat reaches max thread limit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Logging Information when Tomcat reaches max thread limit

Aquib Khan
Hi,

We have a usecase where we want that our application should indicate when it reaches maximum thread limit. Our application is deployed in tomcat. Maximum thread limit of tomcat is 200,  so If 200 threads are reached, does tomcat provide any logger information?

We tried making multiple rest calls and reducing max threads to 2-3. We faced ConnectionRefused and socketTimeout Exceptions on client side. But no exception or logger in Catalina logs. We changed Logging level as well in logging.properties.

We tried Changing values of maxThreads, minspareThread, acceptCount in server.xml. We used Jmeter for making rest calls.

Can we get any help here? Does tomcat provides any information when it reaches max thread limit? Do we have to change any property in server.xml or in logging.properties

Any help in this regard would be highly appreciable.
Thanks in Advance.

Regards,
Aquib
Reply | Threaded
Open this post in threaded view
|

Re: Logging Information when Tomcat reaches max thread limit

Suvendu Sekhar Mondal
Hello Aquib,

On Mon, Nov 2, 2020 at 10:09 AM Aquib Khan <[hidden email]> wrote:
>
> Hi,
>
> We have a usecase where we want that our application should indicate when it reaches maximum thread limit. Our application is deployed in tomcat. Maximum thread limit of tomcat is 200,  so If 200 threads are reached, does tomcat provide any logger information?
>

As far as I know, there is no logging which will tell you that the
thread pool got exhausted but I am pretty sure your application will
react to it by throwing connection related exception as you mentioned
below.
> We tried making multiple rest calls and reducing max threads to 2-3. We faced ConnectionRefused and socketTimeout Exceptions on client side. But no exception or logger in Catalina logs. We changed Logging level as well in logging.properties.
>
> We tried Changing values of maxThreads, minspareThread, acceptCount in server.xml. We used Jmeter for making rest calls.
>
> Can we get any help here? Does tomcat provides any information when it reaches max thread limit? Do we have to change any property in server.xml or in logging.properties
>

Tomcat exposes different thread pool properties via JMX which are
available under JMX Object Name:"Catalina:type=ThreadPool". I think in
your case "currentThreadCount" and "currentThreadsBusy" will be
helpful. "currentThreadCount" will give you thread pool size.
"currentThreadsBusy" will tell you how many threads are busy
processing requests. Normally if the "currentThreadsBusy" count goes
up then it indicates either you have thread blocking or lots of
requests are coming in. Based on those numbers, you need to decide on
the thread pool size. There are more properties and operations exposed
via JMX. You can explore all of them by using jconsole or JMC. If you
have any Application Performance Management(APM) tool like
AppDynamics, Dynatrace, New Relic etc. it will make your life a bit
easier. Those tools usually can throw alerts if thread pool
utilization is high and based on which you can act.

> Any help in this regard would be highly appreciable.
> Thanks in Advance.
>
> Regards,
> Aquib

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]