You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Dignesh <dg...@opentext.com.INVALID> on 2020/07/08 08:39:07 UTC

Lot of worker threads in parked waiting state

Hi,

I am using 7.0.2 version of TomEE.  I notice lot of worker threads (around
500) in timed waiting state. Below is observed in thread stack trace in
thread dumps. These threads are in the same state for hours. Any specific
reason why the threads are in timed waiting state for such long time ?


JmsResourceAdapter-worker- - 1189
priority:5 - threadId:0x00007f4578006800 - nativeId:0x4ddd - nativeId
(decimal):19933 - state:TIMED_WAITING
stackTrace:
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000003ec4197f0> (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
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 java.lang.Thread.run(Thread.java:748)
Locked ownable synchronizers:
- None



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html

Re: Lot of worker threads in parked waiting state

Posted by Jonathan Gallimore <jo...@gmail.com>.
Hi Dignesh

I did some digging around on this. There are two parameters on a
ResourceAdapter you can specify:

 <resource id>.MaximumPoolSize = XX
 <resource id>.CorePoolSize = XX

Which will allow you to have a variable size thread pool. If you swap
out threadPoolSize for these you should get what you're after. Note that
these need the resource id on the front - so if your resource adapter has
an id of "test", you might define it as below:

 <Resource id="test" type="ActiveMQResourceAdapter">
 BrokerXmlConfig =  broker:(tcp://localhost:54545)
 ServerUrl       =  tcp://localhost:54545
 test.MaximumPoolSize = 100
 test.CorePoolSize = 10
 </Resource>

Kind Regards

Jon

On Wed, Jul 8, 2020 at 5:01 PM David Blevins <da...@gmail.com>
wrote:

> Hey Jon and Dignesh,
>
> Could I politely ask we move this thread to the users@ list?
>
> I've sent a couple similar notes to others last week asking for the same
> so want to be fair/consistent to everyone.
>
> Ok to post to dev@ if the thread changes to how to contribute towards the
> fix.
>
>
> -David
>
>
> On Jul 8, 2020, at 5:04 AM, Dignesh <dg...@opentext.com.INVALID> wrote:
>
> Hello Jon,
>
> I don't see any messages to be processed in ActiveMQ. So it means these
> threads are waiting for some work to do. I would expect these threads to go
> back to pool after few seconds/minutes after the work is completed., but
> curious why would it show in thread dumps for such longer time. Also these
> threads are nowt shown in dumps during the initial startup or for some
> time.
> This gets shown up once there is certain load is on the system. And even
> after the system goes back to normal, the dumps still show this threads in
> timed waiting. Any tuning that you can suggest ?
>
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>
>
>

Re: Lot of worker threads in parked waiting state

Posted by David Blevins <da...@gmail.com>.
Hey Jon and Dignesh,

Could I politely ask we move this thread to the users@ list?

I've sent a couple similar notes to others last week asking for the same so want to be fair/consistent to everyone.

Ok to post to dev@ if the thread changes to how to contribute towards the fix.


-David


> On Jul 8, 2020, at 5:04 AM, Dignesh <dg...@opentext.com.INVALID> wrote:
> 
> Hello Jon,
> 
> I don't see any messages to be processed in ActiveMQ. So it means these
> threads are waiting for some work to do. I would expect these threads to go
> back to pool after few seconds/minutes after the work is completed., but
> curious why would it show in thread dumps for such longer time. Also these
> threads are nowt shown in dumps during the initial startup or for some time.
> This gets shown up once there is certain load is on the system. And even
> after the system goes back to normal, the dumps still show this threads in
> timed waiting. Any tuning that you can suggest ?
> 
> 
> 
> 
> 
> --
> Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html


Re: Lot of worker threads in parked waiting state

Posted by Dignesh <dg...@opentext.com.INVALID>.
Hello Jon,

I don't see any messages to be processed in ActiveMQ. So it means these
threads are waiting for some work to do. I would expect these threads to go
back to pool after few seconds/minutes after the work is completed., but
curious why would it show in thread dumps for such longer time. Also these
threads are nowt shown in dumps during the initial startup or for some time.
This gets shown up once there is certain load is on the system. And even
after the system goes back to normal, the dumps still show this threads in
timed waiting. Any tuning that you can suggest ?





--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html

Re: Lot of worker threads in parked waiting state

Posted by Jonathan Gallimore <jo...@gmail.com>.
They look like threads from the Resource Adapter thread pool that are
simply waiting for work to do. If you have 500 in that state, that may
indicate that your thread pool is larger that it needs to be. If you have
stuff waiting to be processed in ActiveMQ, and you still have all the
resource adapter threads idle, then that would indicate an issue that we
ought to investigate further.

Jon

On Wed, Jul 8, 2020 at 9:39 AM Dignesh <dg...@opentext.com.invalid> wrote:

> Hi,
>
> I am using 7.0.2 version of TomEE.  I notice lot of worker threads (around
> 500) in timed waiting state. Below is observed in thread stack trace in
> thread dumps. These threads are in the same state for hours. Any specific
> reason why the threads are in timed waiting state for such long time ?
>
>
> JmsResourceAdapter-worker- - 1189
> priority:5 - threadId:0x00007f4578006800 - nativeId:0x4ddd - nativeId
> (decimal):19933 - state:TIMED_WAITING
> stackTrace:
> java.lang.Thread.State: TIMED_WAITING (parking)
> at sun.misc.Unsafe.park(Native Method)
> - parking to wait for <0x00000003ec4197f0> (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
>
> 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 java.lang.Thread.run(Thread.java:748)
> Locked ownable synchronizers:
> - None
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>