Using JConsole to Monitor Artifactory’s Resource Utilization

JFrog Support
2021-01-07 00:10

JConsole (which is provided with the installed JDK) can be a great resource for monitoring Artifactory's resource utilization. JConsole’s overview tab shows CPU/memory utilization, and how many threads are active.

To connect JConsole to the Artifactory JVM, follow these instructions:

1] In the $ARTIFACTORY_HOME/bin folder, open the artifactory.default file
    In JAVA_OPTIONS, add the following property:

'-Dcom.sun.management.jmxremote'
For example:
export JAVA_OPTIONS="$JAVA_OPTIONS -Djruby.compile.invokedynamic=false -Dfile.encoding=UTF8 -Dartdist=zip -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true"

2] Restart Artifactory for the changes to take effect.

3] The JConsole utility is located in the $JAVA_HOME/bin folder. In Artifactory 7.X this is the /opt/jfrog/artifactory/app/third-party/java/bin folder.
In the $JAVA_HOME location, you’ll need to run the following command:

./jconsole <Artifactory_PID>

For example:

./jconsole 27111

One way to find the Artifactory PID is by running a "ps -ef" command and searching for "artifactory":

ps -ef | grep artifactory

Another way is to run JConsole without a PID (./jconsole). On the JConsole UI, choose the Artifactory process from the Local Process list:

'org.apache.catalina.startup.Bootstrap'