Tomcat monitoring methods

Specific methods:
Method 1: Use the status page that comes with tomcat
Step 1:
Modify the configuration file tomcat-users (this file is in the conf folder in the root directory of the Tomcat installation program), add an admin to set permissions, and set permissions in <tomcat- The content added in users> is as follows:
<role rolename="admin-gui"/>
<user username="admin" password="1234" roles="manager-gui"/>


Step 2:
After the modification is completed, restart the Tomcat server , enter the URL in the browser (http://localhost:8080/), or http//IP:8080;

Step 3:
Click [Sever-Status]
to enter
Account : admin
Password: 1234
Click OK to enter the Tomcat status page

Steps 4:
The basic information mainly includes three parts: JVM, HTTP and jk.
The JVM information is as follows:
Free memory: 304.84 MB Total memory: 903.00 MB Max memory: 7273.00 MB
Free memory: Free memory size.
Total memory: Total memory size.
Max memory:


HTTP related information is as follows:
Max threads: 200 Current thread count: 10 Current thread busy: 1 Keeped alive sockets count: 1Max processing time: 187 ms Processing time: 0.281 s Request count: 32 Error count: 3 Bytes received: 0.00 MB Bytes sent : 0.12 MB
Max threads: The maximum number of threads.
Current thread count: The number of threads running recently.
Max processing time: The maximum CPU time.
Processing time: The total time spent by the CPU.
Request count: The total number of requests.
Error count: The number of bad requests.
Bytes received: The number of bytes received.
Bytes sent: The number of bytes sent.

Method 2: Use JDK's own tools, Jconsole

Step 1: Edit the %tomcat installation path%\bin\catalina.bat file. Add the following:  
set JAVA_OPTS= -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10004 -Dcom.sun.management.jmxremote.ssl=false  -Dcom.sun.management.jmxremote.authenticate=false
   
Step 2: Start tomcat, enter the JDK installation path \jdk1.5.0_22\bin, double-click to open the Jconsole file, and display the Jconsole connection page. Select the process and click connect.

The parameters of jvm are explained as follows:
-Xms minimum heap space
-Xmx maximum heap space-
Xmn new generation space
-Xss thread stack space
-XX:PermSize=xxx permanent generation space
-XX:MaxPermSize=xxx maximum permanent generation space

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326397878&siteId=291194637