[Solution] The website cannot be accessed after running for a period of time, restart Tomcat to restore it

[Background] The website was redeployed, and the operating environment was Linux (centOS6.5) + Tomcat7 + mysql5, and relevant security configuration and system optimization were done;

[Problem] After running for a few days, the website cannot be accessed. Specifically, the page appears blank when entering the homepage of the website, and the ping value of the website is also very unstable;

Check the tomcat access log and find that there are more than 10 access records for the same IP in the same second, and there are many such IP sources;

[Solution] After trying many methods, the problem still exists. The temporary solution is to restart the tomcat process every time;

Later, try to increase the memory size of the JVM, modify ./tomcat/bin/ catalina.sh, and add: JAVA_OPTS="-server-Xms4096m -Xmx4096m -Xmn512m -XX:PermSize=1024M -XX:MaxPermSize=2048m -Xss1024k-XX: SurvivorRatio=4 -XX:MaxTenuringThreshold=20 -XX:+UseParNewGC-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=73-XX:+UseCMSCompactAtFullCollection -XX:+CMSParallelRemarkEnabled-XX:CMSFullGCsBeforeCompaction=2 -Djava.awt.headless=true" 

After restarting tomcat, it ran for a few days without any problems.

Note: The specific parameter size should be combined with the specific configuration of the server.

Guess you like

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