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: Minimum value: Maximum value: Changes take effect after you redeploy the module or restart the server |