Profile Image
Fabrizio Rametta

Do I need to increase the tomcat thread?

The application is a liferay tomcat application. Each time a user performs an operation, some calls are made to another service. To make this call. MultiThreadedHttpConnectionManager is used.

 

The number of thread in tomcat is set to 300, the config of HttpConnection Manager is defaultMaxConnectionsPerHost=128 maxTotalConnections=256.

 

During spike application is working slowly, like there are no available thread to serve httprequest (user wait 30 seconds and then the page is shown).

 

Maybe the ConnectionManager is consuming too much threads?


Report URL - https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjIvMTIvMjEvaW5iYW5hczJfMjAyMl8xMl8yMC50eHQtLTgtNDYtNDY=

  • increase tomcat thread

  • liferay tomcat application

  • MultiThreadedHttpConnectionManager

  • HttpConnection

  • consuming too much threads

Please Sign In or to post your comment or answer

Profile Image

Ram Lakshmanan

Hello Fabrizio!

 

 Greetings. Did you capture the thread dump when your application was slowing down? We need to have the thread dump captured at that period to troubleshoot this problem.

 

 In the current thread dump, I don't see any noticeable problems. Below is the excerpt of the thread groups from your application.

 

 

 "MultiThreadedHTTPConnectionManager" has 36 threads and all the 36 threads are in WAITING state. i.e. they are not doing any work. 

 

 Similarly "ajp" thread group (which is tomcat thread pool) has 78 threads in which 74 of them are also in TIMED_WATING state i.e. they are not doing any work. Only 4 threads are in RUNNABLE state (i.e. doing work)

 

 Based on this thread dump, I don't think thread count needs to be increased. However to give proper recommendation, thread dump that was captured during slow down period should be studied. 

Profile Image

Fabrizio Rametta

Hi Ram,

 

You are right of course.

 

The dump was taken when the system was healthy. But our client asked us to verify if there are however some problems and of course there are not.

 

We can't take dumps in production so we ask to devops whenever they alert us about slowness. But they aren't so rapid.

 

I sent them an email for the future also to take 3 dumps each ten seconds to verify if some running thread are still running on the same action in a 30 sec interval and so not other requests can be served.

 

Plus I hope they can print thread information with extended options,  to see the time and the memory consumption (in this dump it is not present right?)

 

I let you know whenever dumps will be available.

 

Thank you

 

 

Profile Image

Ram Lakshmanan

Hello Fabrizo!

 

 Greetings.

 

 Taking 3 thread dumps is a good idea. But consider to keep 10 second interval between each dump instead of 30 seconds. 30 seconds is too long for modern applications. Thread dump is a vital artifact to triage these sort of problems, however they don't give complete story. You might need other artifacts as well: GC log, netstat, vmstat, iostat, disk usage, ....

 

 You may consider having your client use this open source script. This script captures 16 artifacts in pristine state. It will give 360-degree view of the problem.

 

 Thanks.

 

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • increase tomcat thread

  • liferay tomcat application

  • MultiThreadedHttpConnectionManager

  • HttpConnection

  • consuming too much threads