You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by 이의준 <ej...@time-gate.com> on 2018/03/27 05:50:45 UTC

Thread state differences according to Tomcat 7, 8 version.

Hi ! 

English is not my native language; please excuse typing errors.

 

Why is Tomcat not handling requests with 8 versions, but in the RUNNABLE
state, not the TIME_WAITING state of the Tomcat 7 version?

Please confirm that this operation works normally.

 

#################Tomcat 7.0.75  jdk 1.7.0.65

 

#server.xml

    <!-- Define an AJP 1.3 Connector on port 8009 -->

    <Connector port="7009" protocol="AJP/1.3" redirectPort="9443"
URIEncoding="UTF-8"

      acceptCount="200" acceptorThreadCount="2" maxThreads="300"

      minSpareThreads="50" connectionTimeout="15000"/>

 

#There are more than 40 threads with the following stacks:

 

"ajp-apr-7009-exec-111" #10247 daemon prio=5 os_prio=0
tid=0x00007fa6b811f000 nid=0x2f51 waiting on condition [0x00007fa6aa7b8000]

   java.lang.Thread.State: TIMED_WAITING (parking)

           at sun.misc.Unsafe.park(Native Method)

           - parking to wait for  <0x0000000083769178> (a
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)

           at
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)

           at
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitN
anos(AbstractQueuedSynchronizer.java:2078)

           at
java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)

           at
org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:86)

           at
org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:32)

           at
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066
)

           at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
27)

           at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
17)

           at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.ja
va:61)

           at java.lang.Thread.run(Thread.java:745)

 

 

############Tomcat 8.0.44 jdk 1.8.0.131

 

#server.xml

    <!-- Define an AJP 1.3 Connector on port 8009 -->

    <Connector port="7009" protocol="AJP/1.3" redirectPort="9443"
URIEncoding="UTF-8"

      acceptCount="200" acceptorThreadCount="2" maxThreads="300"

      minSpareThreads="50" connectionTimeout="15000"/>

 

There are more than 50 threads with the following stacks:

 

"ajp-apr-7009-exec-1083" #19321 daemon prio=5 os_prio=0
tid=0x00007fcd1405d800 nid=0x19fe runnable [0x00007fcc373f2000]

   java.lang.Thread.State: RUNNABLE

           at org.apache.tomcat.jni.Socket.recvbb(Native Method)

           at
org.apache.coyote.ajp.AjpAprProcessor.readSocket(AjpAprProcessor.java:256)

           at
org.apache.coyote.ajp.AjpAprProcessor.read(AjpAprProcessor.java:197)

           at
org.apache.coyote.ajp.AbstractAjpProcessor.readMessage(AbstractAjpProcessor.
java:1091)

           at
org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java
:804)

           at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abstrac
tProtocol.java:684)

           at
org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEnd
point.java:2458)

           - locked <0x00000000f6bce3a0> (a
org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper)

           at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
42)

           at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
17)

           at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.ja
va:61)

           at java.lang.Thread.run(Thread.java:748)

 

Best regards


RE: Thread state differences according to Tomcat 7, 8 version.

Posted by 이의준 <ej...@time-gate.com>.
Test sequence and inquiry contents
1. In the local test, the same load (hp-jmeter) for tomcat 7, 8 5 minutes,
2. Thread dump generated after 5 minutes of load termination
3. Thread in Tomcat 7 is in TIME_WAITING state (normally OK)
4. Thread in Tomcat 8 mostly RUNNABLE state (estimated to be abnormal)
     Thread Final Stack - Below (reading something)
     at org.apache.tomcat.jni.Socket.recvbb (Native Method)

5. Is the thread status of Tomcat 8 normal?
6. Does Tomcat 7 and Thread work differently?

Best regards

-----Original Message-----
From: 이의준 <ej...@time-gate.com> 
Sent: Tuesday, March 27, 2018 10:47 PM
To: Rainer Jung <ra...@kippdata.de>; Tomcat Users List <us...@tomcat.apache.org>
Subject: Re: Thread state differences according to Tomcat 7, 8 version.

Thank you for answer.
​
As a further explanation, after a certain amount of time has elapsed after applying the same load to both groups, all threads in the tomcat7 group are in the TIME-WAITING state, and TOMCAT8 is in the RUNNABLE state.
So I guess there is a difference in THREAD behavior between Tomcat versions.
​
-----Original Message-----
From: "Rainer Jung"<ra...@kippdata.de>
To: "Tomcat Users List"<us...@tomcat.apache.org>; "이의준"<ej...@time-gate.com>;
Cc:
Sent: 2018-03-27 (화) 22:16:20
Subject: Re: Thread state differences according to Tomcat 7, 8 version.
 
See below

Am 27.03.2018 um 07:50 schrieb 이의준:
> Hi !
>
> English is not my native language; please excuse typing errors.
>
> Why is Tomcat not handling requests with 8 versions, but in the 
> RUNNABLE state, not the TIME_WAITING state of the Tomcat 7 version?
>
> Please confirm that this operation works normally.
>
>  
>
> #################Tomcat 7.0.75  jdk 1.7.0.65
>
>  
>
> #server.xml
>
>      <!-- Define an AJP 1.3 Connector on port 8009 -->
>
>      <Connector port="7009" protocol="AJP/1.3" redirectPort="9443"
> URIEncoding="UTF-8"
>
>        acceptCount="200" acceptorThreadCount="2" maxThreads="300"
>
>        minSpareThreads="50" connectionTimeout="15000"/>
>
>  
>
> #There are more than 40 threads with the following stacks:
>
>  
>
> "ajp-apr-7009-exec-111" #10247 daemon prio=5 os_prio=0
> tid=0x00007fa6b811f000 nid=0x2f51 waiting on condition 
> [0x00007fa6aa7b8000]
>
>     java.lang.Thread.State: TIMED_WAITING (parking)
>
>             at sun.misc.Unsafe.park(Native Method)
>
>             - parking to wait for  <0x0000000083769178> (a
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>
>             at
> java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
>
>             at
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.
> awaitN
> anos(AbstractQueuedSynchronizer.java:2078)
>
>             at
> java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java
> :467)
>
>             at
> org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:86)
>
>             at
> org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:32)
>
>             at
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.jav
> a:1066
> )
>
>             at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.j
> ava:11
> 27)
>
>             at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
> java:6
> 17)
>
>             at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThr
> ead.ja
> va:61)
>
>             at java.lang.Thread.run(Thread.java:745)

These are thread idle in the thread pool.

> ############Tomcat 8.0.44 jdk 1.8.0.131
>
>  
>
> #server.xml
>
>      <!-- Define an AJP 1.3 Connector on port 8009 -->
>
>      <Connector port="7009" protocol="AJP/1.3" redirectPort="9443"
> URIEncoding="UTF-8"
>
>        acceptCount="200" acceptorThreadCount="2" maxThreads="300"
>
>        minSpareThreads="50" connectionTimeout="15000"/>
>
>  
>
> There are more than 50 threads with the following stacks:
>
>  
>
> "ajp-apr-7009-exec-1083" #19321 daemon prio=5 os_prio=0
> tid=0x00007fcd1405d800 nid=0x19fe runnable [0x00007fcc373f2000]
>
>     java.lang.Thread.State: RUNNABLE
>
>             at org.apache.tomcat.jni.Socket.recvbb(Native Method)
>
>             at
> org.apache.coyote.ajp.AjpAprProcessor.readSocket(AjpAprProcessor.java:
> 256)
>
>             at
> org.apache.coyote.ajp.AjpAprProcessor.read(AjpAprProcessor.java:197)
>
>             at
> org.apache.coyote.ajp.AbstractAjpProcessor.readMessage(AbstractAjpProcessor.
> java:1091)
>
>             at
> org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcesso
> r.java
> :804)
>
>             at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(A
> bstrac
> tProtocol.java:684)
>
>             at
> org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(
> AprEnd
> point.java:2458)
>
>             - locked <0x00000000f6bce3a0> (a
> org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper)
>
>             at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.j
> ava:11
> 42)
>
>             at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
> java:6
> 17)
>
>             at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThr
> ead.ja
> va:61)
>
>             at java.lang.Thread.run(Thread.java:748)


These are threads which are busy from the point of view of the thread pool, but what they are doing is waiting for more data to arrive on a connection they handle.

So the two groups of threads you have chosen are really in a different state, not only Tomcat or Java version wise.

Regards,

Rainer



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Thread state differences according to Tomcat 7, 8 version.

Posted by 이의준 <ej...@time-gate.com>.
Thank you for answer.
​
As a further explanation, after a certain amount of time has elapsed after applying the same load to both groups, all threads in the tomcat7 group are in the TIME-WAITING state, and TOMCAT8 is in the RUNNABLE state.
So I guess there is a difference in THREAD behavior between Tomcat versions.
​
-----Original Message-----
From: "Rainer Jung"<ra...@kippdata.de>
To: "Tomcat Users List"<us...@tomcat.apache.org>; "이의준"<ej...@time-gate.com>;
Cc:
Sent: 2018-03-27 (화) 22:16:20
Subject: Re: Thread state differences according to Tomcat 7, 8 version.
 
See below

Am 27.03.2018 um 07:50 schrieb 이의준:
> Hi !
>
> English is not my native language; please excuse typing errors.
>
> Why is Tomcat not handling requests with 8 versions, but in the RUNNABLE
> state, not the TIME_WAITING state of the Tomcat 7 version?
>
> Please confirm that this operation works normally.
>
>  
>
> #################Tomcat 7.0.75  jdk 1.7.0.65
>
>  
>
> #server.xml
>
>      <!-- Define an AJP 1.3 Connector on port 8009 -->
>
>      <Connector port="7009" protocol="AJP/1.3" redirectPort="9443"
> URIEncoding="UTF-8"
>
>        acceptCount="200" acceptorThreadCount="2" maxThreads="300"
>
>        minSpareThreads="50" connectionTimeout="15000"/>
>
>  
>
> #There are more than 40 threads with the following stacks:
>
>  
>
> "ajp-apr-7009-exec-111" #10247 daemon prio=5 os_prio=0
> tid=0x00007fa6b811f000 nid=0x2f51 waiting on condition [0x00007fa6aa7b8000]
>
>     java.lang.Thread.State: TIMED_WAITING (parking)
>
>             at sun.misc.Unsafe.park(Native Method)
>
>             - parking to wait for  <0x0000000083769178> (a
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>
>             at
> java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
>
>             at
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitN
> anos(AbstractQueuedSynchronizer.java:2078)
>
>             at
> java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
>
>             at
> org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:86)
>
>             at
> org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:32)
>
>             at
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066
> )
>
>             at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
> 27)
>
>             at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
> 17)
>
>             at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.ja
> va:61)
>
>             at java.lang.Thread.run(Thread.java:745)

These are thread idle in the thread pool.

> ############Tomcat 8.0.44 jdk 1.8.0.131
>
>  
>
> #server.xml
>
>      <!-- Define an AJP 1.3 Connector on port 8009 -->
>
>      <Connector port="7009" protocol="AJP/1.3" redirectPort="9443"
> URIEncoding="UTF-8"
>
>        acceptCount="200" acceptorThreadCount="2" maxThreads="300"
>
>        minSpareThreads="50" connectionTimeout="15000"/>
>
>  
>
> There are more than 50 threads with the following stacks:
>
>  
>
> "ajp-apr-7009-exec-1083" #19321 daemon prio=5 os_prio=0
> tid=0x00007fcd1405d800 nid=0x19fe runnable [0x00007fcc373f2000]
>
>     java.lang.Thread.State: RUNNABLE
>
>             at org.apache.tomcat.jni.Socket.recvbb(Native Method)
>
>             at
> org.apache.coyote.ajp.AjpAprProcessor.readSocket(AjpAprProcessor.java:256)
>
>             at
> org.apache.coyote.ajp.AjpAprProcessor.read(AjpAprProcessor.java:197)
>
>             at
> org.apache.coyote.ajp.AbstractAjpProcessor.readMessage(AbstractAjpProcessor.
> java:1091)
>
>             at
> org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java
> :804)
>
>             at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abstrac
> tProtocol.java:684)
>
>             at
> org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEnd
> point.java:2458)
>
>             - locked <0x00000000f6bce3a0> (a
> org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper)
>
>             at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
> 42)
>
>             at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
> 17)
>
>             at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.ja
> va:61)
>
>             at java.lang.Thread.run(Thread.java:748)


These are threads which are busy from the point of view of the thread
pool, but what they are doing is waiting for more data to arrive on a
connection they handle.

So the two groups of threads you have chosen are really in a different
state, not only Tomcat or Java version wise.

Regards,

Rainer

Re: Thread state differences according to Tomcat 7, 8 version.

Posted by Rainer Jung <ra...@kippdata.de>.
See below

Am 27.03.2018 um 07:50 schrieb 이의준:
> Hi !
> 
> English is not my native language; please excuse typing errors.
> 
> Why is Tomcat not handling requests with 8 versions, but in the RUNNABLE
> state, not the TIME_WAITING state of the Tomcat 7 version?
> 
> Please confirm that this operation works normally.
> 
>   
> 
> #################Tomcat 7.0.75  jdk 1.7.0.65
> 
>   
> 
> #server.xml
> 
>      <!-- Define an AJP 1.3 Connector on port 8009 -->
> 
>      <Connector port="7009" protocol="AJP/1.3" redirectPort="9443"
> URIEncoding="UTF-8"
> 
>        acceptCount="200" acceptorThreadCount="2" maxThreads="300"
> 
>        minSpareThreads="50" connectionTimeout="15000"/>
> 
>   
> 
> #There are more than 40 threads with the following stacks:
> 
>   
> 
> "ajp-apr-7009-exec-111" #10247 daemon prio=5 os_prio=0
> tid=0x00007fa6b811f000 nid=0x2f51 waiting on condition [0x00007fa6aa7b8000]
> 
>     java.lang.Thread.State: TIMED_WAITING (parking)
> 
>             at sun.misc.Unsafe.park(Native Method)
> 
>             - parking to wait for  <0x0000000083769178> (a
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
> 
>             at
> java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
> 
>             at
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitN
> anos(AbstractQueuedSynchronizer.java:2078)
> 
>             at
> java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
> 
>             at
> org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:86)
> 
>             at
> org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:32)
> 
>             at
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066
> )
> 
>             at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
> 27)
> 
>             at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
> 17)
> 
>             at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.ja
> va:61)
> 
>             at java.lang.Thread.run(Thread.java:745)

These are thread idle in the thread pool.

> ############Tomcat 8.0.44 jdk 1.8.0.131
> 
>   
> 
> #server.xml
> 
>      <!-- Define an AJP 1.3 Connector on port 8009 -->
> 
>      <Connector port="7009" protocol="AJP/1.3" redirectPort="9443"
> URIEncoding="UTF-8"
> 
>        acceptCount="200" acceptorThreadCount="2" maxThreads="300"
> 
>        minSpareThreads="50" connectionTimeout="15000"/>
> 
>   
> 
> There are more than 50 threads with the following stacks:
> 
>   
> 
> "ajp-apr-7009-exec-1083" #19321 daemon prio=5 os_prio=0
> tid=0x00007fcd1405d800 nid=0x19fe runnable [0x00007fcc373f2000]
> 
>     java.lang.Thread.State: RUNNABLE
> 
>             at org.apache.tomcat.jni.Socket.recvbb(Native Method)
> 
>             at
> org.apache.coyote.ajp.AjpAprProcessor.readSocket(AjpAprProcessor.java:256)
> 
>             at
> org.apache.coyote.ajp.AjpAprProcessor.read(AjpAprProcessor.java:197)
> 
>             at
> org.apache.coyote.ajp.AbstractAjpProcessor.readMessage(AbstractAjpProcessor.
> java:1091)
> 
>             at
> org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java
> :804)
> 
>             at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abstrac
> tProtocol.java:684)
> 
>             at
> org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEnd
> point.java:2458)
> 
>             - locked <0x00000000f6bce3a0> (a
> org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper)
> 
>             at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
> 42)
> 
>             at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
> 17)
> 
>             at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.ja
> va:61)
> 
>             at java.lang.Thread.run(Thread.java:748)


These are threads which are busy from the point of view of the thread 
pool, but what they are doing is waiting for more data to arrive on a 
connection they handle.

So the two groups of threads you have chosen are really in a different 
state, not only Tomcat or Java version wise.

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org