Profile Image
Navin Amarasiri

TIMED_WAITING threads on Tomcat

Hi Team, I'm trying to understand why lots of http threads park for waiting. Appreciate your insight. Thank you.

 

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

  • timedwaitingthraeds

  • tomcat

  • httpthreads

  • nioconnectorthreadpool

  • reachedthelimitof8080connectors

  • maxthreads

  • serverxml

Please Sign In or to post your comment or answer

Profile Image

Mahesh

Hi Navin,

 

As I could see in your report, 248 threads are in the TIMED_WAITING state. These all threads are having the following same stacktrace.

stackTrace:
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000a2c18488> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
at org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:89)
at org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:33)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1073)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

 

These are your tomcat server's nio connector thread pool. Probably you have reached the limit of 8080 connectors thread pool size and all incoming requests are stacked in a queue and waiting a released thread. The default value for maxThreads is 200, but this value can be changed in your configuration. Maybe you want to reduce the minimum thread pool size of the tomcat server's nio. Typically tomcat server's thread pool sizes are defined in the 'connector' element of the "TOMCAT_FOLDER/conf/server.xml" file.

 

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • timedwaitingthraeds

  • tomcat

  • httpthreads

  • nioconnectorthreadpool

  • reachedthelimitof8080connectors

  • maxthreads

  • serverxml