Oracle WebLogic Monitoring Analyze Stuck And Hogging Threads
How to Stuck Thread Occurs?
A Stuck Thread is a thread which is processing a request for more than maximum time that you configured in WebLogic admin console. By Default, the WebLogic server comes with 600 secs. If some thread doesn’t return in 600 secs, It gets a flag ‘stuck thread’.
How to deal with Stuck Thread?
Take thread dumps instantly.
Open thread dumps in visualVM. Analyze dashboard from WebLogic console (managed server > monitoring > threads).
Open thread dump files in “WLSDM Menu > Monitoring & Diagnostics > Profiling Dumps”.
Monitoring Thread Dump
See how many threads got stuck?
If the stuck thread count is increasing, decreasing or constant ?
If constant then if got stuck on application code etc or not ?
Stuck Thread Count Dashboard
If getting increase then there would be some serious problem and you have to do a quick health check of you application server, database and other integrated technologies wherever your application reaching like ldap server for authentication, some other API’s or web services etc, and in parallel review thread dumps for stuck threads.
If you have one, two or few constant stuck threads and it’s not increasing so much then you can monitor in WLSDM it for some more time to check if they get clear or not, if not then to clear them you have only option to restart your managed server(s), and its better to restart and clear them before they make further any impact.
What is Hogging Thread?
A hogging thread is a thread which is taking more than usual time to complete the request and can be declared as Stuck .
How Weblogic determine a thread to declare as hogging?
A thread declared as Stuck if it runs over 600 secs (default configuration which you can increase or decrease from admin console).
There is an internal WebLogic polar which runs every 2 secs (by default 2 secs and can be alter)
It checks for the number of requests completed in last two minutes
Then it check how much times each took to complete
Then it takes the average time of all completed request (completed in last 2 sec)
View Hogging Threads in WLSDM
Then multiply average time with 7, and the value came consider as “usual time to complete the request”
Now weblogic check each current executed thread in last 2 secs and compare with above average time, if for any of the thread it’s above this value then that thread will declare as Hogged thread.
Other WLSDM Stuck and hogger thread articles:
Installation is really easy and you can setup a complete monitoring infrastructure in less than 5 minutes. If you want to try then go to download page below URL: