ThreadPool has stuck threads

weblogic 10后台出现警告,原因:ThreadPool has stuck threads

在WEBLOGIC中如果一个线程执行时间超过了Stuck Thread Max Time规定的时间,

WEBLOGIC会把它认为是STUCK线程,并记录在日志中。

我们也可以通过'Dump Thread Stacks' 来捕获STUCK状态的进程。

Home > Summary of Servers > AdminServer>Monitoring>Performance>'Dump Thread Stacks'

 但并不是每次'Dump Thread Stacks' 都能捕获Stuck状态的进程。

 只有在线程执行时间超过了Stuck Thread Max Time规定的时间

 我们才有可能通过'Dump Thread Stacks' 或WEBLOGIC的日志捕获它。

 

通常我们通过'Dump Thread Stacks'能捕获到以下信息。

"[STUCK] ExecuteThread: '20' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE native         

jrockit.NET.SocketNativeIO.readBytesPinned(Native Method)

jrockit.Net.SocketNativeIO.socketRead(SocketNativeIO.Java:32)

java.net.SocketInputStream.socketRead0(SocketInputStream.java)

java.net.SocketInputStream.read(SocketInputStream.java:129)

java.io.BufferedInputStream.fill(BufferedInputStream.java:218)

java.io.BufferedInputStream.read1(BufferedInputStream.java:256)

java.io.BufferedInputStream.read(BufferedInputStream.java:313)

com.informix.asf.IfxDataInputStream.readFully(IfxDataInputStream.java:146)

com.informix.asf.IfxDataInputStream.readSmallInt(IfxDataInputStream.java:453)

在WEBLOGIC的日志中我们能看到如下信息:

<2010-11-8 下午02时38分28秒 CST> <Error> <WebLogicServer> <BEA-000337> <[STUCK]
 ExecuteThread: '189' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "115" seconds
 working on the request "Http Request: /prpall/business/selectPolicy.do", which is more than the configured
 time (StuckThreadMaxTime) of "30" seconds. Stack trace:
        java.net.SocketInputStream.socketRead0(Native Method)
        java.net.SocketInputStream.read(SocketInputStream.java:129)
        java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
        java.io.BufferedInputStream.read(BufferedInputStream.java:313)
        com.informix.asf.IfxDataInputStream.readFully(IfxDataInputStream.java:146)
        com.informix.asf.IfxDataInputStream.readSmallInt(IfxDataInputStream.java:453)
        com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2495)
        com.informix.jdbc.IfxSqli.a(IfxSqli.java:1752)
        com.informix.jdbc.IfxSqli.executeStatementQuery(IfxSqli.java:1704)
        com.informix.jdbc.IfxSqli.executeStatementQuery(IfxSqli.java:1635)
        com.informix.jdbc.IfxResultSet.a(IfxResultSet.java:206)
        com.informix.jdbc.IfxStatement.executeQueryImpl(IfxStatement.java:1229)
        com.informix.jdbc.IfxPreparedStatement.executeQuery(IfxPreparedStatement.java:376)
        weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:100)

在压力测试阶段为了捕获执行时间长的进程我们可以调整

weblogic中的Stuck Thread Max Time 为一个较小的值。

来捕获并发测试时stuck状态的进程。比如30秒。

通常在产品环境中设置此参数值为600秒。

Home > Summary of Servers > AdminServer  >Tuning >Stuck Thread Max Time

以下是weblogic的联机文档中对Stuck Thread Max Time 的解释

 

The number of seconds that a thread must be continually working before this server considers the thread stuck.

For example, if you set this to 600 seconds, WebLogic Server considers a thread to be "stuck" after 600 seconds of continuous use.

In Web Logic Server 9.x and later, it is recommended that you use the ServerFailureTriggerMBean in the OverloadProtectionMBean. The ServerFailureTriggerMBean transitions the server to a FAILED state after the specified number of stuck threads are detected. The OverloadProtectionMBean has options to suspend or shutdown a failed server.

MBean Attribute:
ServerMBean.StuckThreadMaxTime

Minimum value: 0

Maximum value: 2147483647

Changes take effect after you redeploy the module or restart the server

原文地址:https://www.cnblogs.com/jjzd/p/6349274.html