3 Replies Latest reply: Jul 22, 2014 8:41 AM by 2678853 RSS

    Find user who caused Stuck Thread in WLST

    2678853

      Whenever there is a stuck thread, we would provide a bunch of info to the developers to determine the issue. One of the info being the user that cause it through the weblogic console. I am looking for a way to script all of this information but have not be able to locate the attribute needed to get the user. Can anyone help?

      Thanks.

        • 1. Re: Find user who caused Stuck Thread in WLST
          Vishal Iyer-Oracle

          Hello User,

           

          I am still not sure about what you are trying to acheieve through the scripts . If you looking for some shell script to take thread dump and capture any other information with that.

           

          You can probably start with this script.

           

          #

          # Takes an argument (PID of the WLS process) and loops three times. This will append the top information to a file called dump_high_cpu.txt.

          # The thread dump information will either be in file where stdout was redirected or printed on the screen.

          #

           

          for loopnum in 1 2 3

          do

          kill -3 $1

          echo "cpu snapshot and thread dump done. #" $loopnum

          sleep 1

          echo "Done sleeping."

          done

           

          save this file as threaddump.sh

          ./threaddump <<pid>>

           

          Please let me know if you are looking for any further information to be captured, we can probably modify the script to capture it.

           

          Regards,

          Vishal Iyer

          • 2. Re: Find user who caused Stuck Thread in WLST
            Vijaya Moderator -Oracle

            Hi there,

             

            You cannot have a automated script to run when there are stuck threads in your environment.

             

            Well you'll have to closely observe the environment and issue the command below or run the script as suggested by Vishal Iyer in his last update.

             

            java weblogic.WLST

            connect("<username>","<password>","t3://<url>:<port>")

            threadDump()

             

            The thread dump will be generated in Thread_Dump_AdminServer.txt

             

            Note 1274713.1 addresses WLST thread dump in more details with examples on how to define sleep time between each dump and number of dumps to take.

             

             

            Hope this helps!!

             

            Thanks,

            Vijaya

            • 3. Re: Find user who caused Stuck Thread in WLST
              2678853

              Thanks for the reply. We currently have a script to take thread dumps for closer observation. This script I have been working on is just to get targetted info. Here is a sample of our output we have been sending through email:

               

              SERVER NAME : managed_server4

              SERVER STATE : RUNNING

              SERVER HEALTH STATE :HEALTH_WARN

              SERVICE TIME : 128.91859468723223

              AVERAGE SERVICE TIME : 61

              ACTIVE SESSIONS : 7

              Active Connection with dbDS (current/max) : 283/4000

              Active Connection with pssdbDS (current/max) : 0/1200

              Active Connection with txndbDS (current/max) : 0/600

               

              I'm looking for a way to locate the user who is triggering the stuck thread state. I can see it through the weblogic console but I am unable to locate it from WLST.