Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-26320

Automatically schedule thread dumps

    XMLWordPrintable

    Details

    • Location:
      External

      Description

      This relates to ticket 177207 on the internal JFrog support portal.

      We would like to request a feature that allow any JFrog product that utilizes java to automatically generate thread dumps in a specific manner upon performance degradation.

      Here is the current approach used on our side for Artifactory specifically:

      1. Create a shell script that scans the access server time; if it shows a request taking longer than 10 seconds create a thread dump. Script
        #!/bin/bash
        
        if [[ "$USER" != artifactory ]]; then
            echo "This script must be run as artifactory user."
            exit 1
        fi
        
        JSTACKBIN='/usr/lib/jvm/java-11-openjdk-amd64/bin/jstack'
        
        tail -Fn0 /opt/jfrog/artifactory/logs/request.log | \
        while read line
        do
            request_duration=$(echo "$line" | awk -F\| '/\/api\/system\/ping/ { print $2}')
            if [[ $request_duration -gt 10000 ]]; then
                for i in {1..6};
                do
                    TOMCAT_PID=$(pgrep java)
                    $JSTACKBIN -l $TOMCAT_PID > "/var/tmp/artifactory.$(date +%Y%m%d%H%M%S).td"
                done
            fi
        done
        
      2. Run the script in the background via following command:
        $ nohup sudo -u artifactory /opt/jfrog/artifactory/automated-thread-dump.sh >> /var/tmp/artifactory-automated-thread-dump-nohup.log 2>&1 &
        
      3. Monitor the directory or file for any changes and send notifications if created.

      It would be preferred if this could be automagically created by the java application upon particular triggers determined by the JFrog developers upon a clear window of performance degradation.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            a2m8ftw2020 Andreas Drbal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Sync Status

                Connection: RTFACT Sync
                RTMID-26322 -
                SYNCHRONIZED
                • Last Sync Date: