Oui, nous faisons le profil des applications Tomcat.
Aller à catalina.bat
ou catalina.sh
et ceci à votre JAVA_OPTS
(J'utilise Tomcat 6.0.16):
-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
Votre JAVA_OPTS
devrait ressembler à
set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties" -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
Mis à jour après commentaire Ryan qu'il est préférable d'utiliser setenv.sh
. Ceci est mon setenv.sh
pour JDK 8. Manquant quelques autres paramètres, mais bon pour commencer.
SUN_JVM_OPTS="
-server \
-XX:MaxMetaspaceSize=3G \
-XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled \
-XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 \
-XX:+ScavengeBeforeFullGC -XX:+CMSScavengeBeforeRemark \
-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=3 -XX:GCLogFileSize=2M \
-XX:+HeapDumpOnOutOfMemoryError \
-Dsun.net.inetaddr.ttl=60 \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=8480 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false"
# Set custom application options here
APPLICATION_OPTS="-Dlog4j.configurationFile=patht-to-log/log4j2.xml -Dlog4j.debug=true "
JVM_OPTS="$GENERAL_JVM_OPTS $SUN_JVM_OPTS"
CATALINA_OPTS="$JVM_OPTS $APPLICATION_OPTS"
echo "Tomcat started with settings "$CATALINA_OPTS
Une fois que vous laissez tomber le setenv.sh
dans le répertoire bin, vous pouvez voir les changements dans la console au démarrage.
Voici un autre tutoriel étape par étape au profil des applications Tomcat avec Visual VM: Trouble shooting application performance with Visual VM
Est-ce que quelqu'un utilise VisualVM pour profiler les applications Tomcat? – rwsimmo
Je ne vois pas d'onglet "profil" lors de la connexion via JMX ou JStatd. Ai-je besoin de versions spéciales de java ou jvisualvm? – Jan
Je ne vois pas non plus d'onglet "profil" lors de la connexion via JMX. Ce problème a-t-il été résolu pour les autres? – Glennn