Knowledgebase:
WebLogic Stuck Thread Explained
Posted by Ben Collins on 12 September 2018 01:00 PM

APPLIES TO:

Oracle WebLogic Server - Version 10.0 and later
Information in this document applies to any platform.
***Checked for relevance on 10-Aug-2016***

GOAL

The purpose of this note is to provide a formal definition of stuck threads in WebLogic Server.

SOLUTION

Stuck Thread

A thread might get stuck for various reasons. For example: When an SQL query is running and the time it takes to complete is say 800 seconds, then, as the default stuck thread timing is 600 seconds in WebLogic Server, the thread allocated for that query waits for 600 seconds and goes to stuck state.

The stuck state does not mean that it is stuck forever, and it might get unstuck at a later point of time which can be checked in the logs. But if there is no reference like that in the logs, then we might infer that the thread got stuck forever.

Tuning the Execute Thread Detection Behavior

WebLogic Server automatically detects when a thread in an execute queue becomes "stuck." Because a stuck thread cannot complete its current work or accept new work, the server logs a message each time it diagnoses a stuck thread.

If all threads in an execute queue become stuck, the server changes its health state to either "warning" or "critical" depending on the execute queue.

If all threads in the default queue become stuck, the server changes its health state to "critical." (The Node Manager application can automatically shut down and restart servers in the critical health state.)

If all threads in weblogic.admin.HTTP, weblogic.admin.RMI, or a user-defined execute queue become stuck, the server changes its health state to "warning."

WebLogic Server diagnoses a thread as stuck if it is continually working (not idle) for a set period of time. You can tune a server's thread detection behavior by changing the length of time before a thread is diagnosed as stuck, and by changing the frequency with which the server checks for stuck threads.

NOTE: Although you can change the criteria WebLogic Server uses to determine whether a thread is stuck, you cannot change the default behavior of setting the "warning" and "critical" health states when all threads in a particular execute queue become stuck.

To configure WebLogic Server stuck thread detection behavior

  1. Start the Administration Server if it is not already running.
  2. Access the Administration Console for the domain.
  3. Expand the Servers node in the left pane to display the servers configured in your domain.
  4. Click the name of the server instance that you want to modify for improved stuck thread detection.
  5. Select the Configuration -> Tuning tab in the right pane.
  6. Modify the following attributes as necessary to tune thread detection behavior for the server:
    Stuck Thread Max Time: Enter the number of seconds, that a thread must be continually working before this server diagnoses the thread as being stuck. By default, WebLogic Server considers a thread to be "stuck" after 600 seconds of continuous use.

    Stuck Thread Timer Interval: Enter the number of seconds, after which WebLogic Server periodically scans threads to see if they have been continually working for the length of time specified by Stuck Thread Max Time. By default, WebLogic Server sets this interval to 600 seconds.
  7. Click Apply to save your changes.
  8. Reboot the server to use the new settings.
NOTE: You configure stuck thread detection parameters on a per-server basis, rather than on a per-execute queue basis
(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: