Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Application server-Tomcat

Shulou Source: shulou.com Published: 2022-06-03 04:58:24 11月25日 Update

1. Configuration file: vi / usr/local/tomcat7/conf/server.xml

two。 Launch: cd / usr/local/tomcat7/bin sh startup.sh

3. Log: cd / usr/local/tomcat7/logs tail-f catalina.out

4. View the log while starting:

/ usr/local/tomcat7/bin/startup.sh & tail-f / usr/local/tomcat7/logs/catalina.out

5. Kill the process: ps-ef | grep java kill-9 pid

6. Monitor and control

Cd / usr/local/tomcat7/conf vi tomcat-users.xml

Complete configuration, save, restart tomcat

Then visit the tomcat page

Enter the configured user name and password to enter the page

7. Parameter optimization

Basically, which resource types need to be compressed in vi / usr/local/tomcat7/conf/server.xml?

Adjust the maximum number of concurrent connections in tomcat (focus)

Error message: org.apache.tomcat.util.threads.ThreadPool logFull SERVER: ALL threads (250) are currently busy,waiting. Increase maxThreads (250) or check the servlet status

MaxThreads: for more information on how big the setting is, you can refer to Current thread count in the tomcat page / server status page, which is at least larger than this.

AcceptCount: when the number of requests is large, some requests that cannot be processed in time will be crammed into acceptCount. When acceptCount is full, the request will be discarded and the connection rejected error will be reported. If it is Nginx, it will report 502error. These two linkage configurations. Reference https://my.oschina.net/weiweiblog/blog/3040849

8. What are the aspects of tuning tomcat

Hardware

Operation mode

Parameters (including tomcat parameters, JVM parameters)

JDK version

Deployment mode (with other combinations, learning from each other's strengths to offset their weaknesses)

Tags: Parameters pages configuration log time mode user thread error will report reference process run maximum learn from each other information key at the same time domain name password Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple macOS Microsoft Docker MariaDB