tomcat startup scan causes slow startup

tomcat has to wait a long time every time it comes to this place when it starts up

2018-04-25 02:33:37,449 [main] INFO  org.apache.catalina.core.StandardEngine- Starting Servlet Engine: Apache Tomcat/7.0.70
2018-04-25 02:33:37,449 [main] INFO  org.apache.catalina.core.StandardEngine- Starting Servlet Engine: Apache Tomcat/7.0.70
2018-04-25 02:57:10,655 [localhost-startStop-1] INFO  org.apache.catalina.startup.TldConfig- At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2018-04-25 02:57:10,655 [localhost-startStop-1] INFO  org.apache.catalina.startup.TldConfig- At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

It can be seen that TLD scan actually took as much as 24 minutes to read a circle of information https://blog.csdn.net/renfufei/article/details/70878077 This thing actually scans twice. What is the reason for the scan? slow? Start to exclude external factors, no longer mount mfs before startup

/data/www/app/latest/WEB-INF/uploads

The total amount of files in mfs is about 19GB. It takes 5-10 minutes to scan the full amount once in the same computer room. If it is not in the same computer room, the speed is expected to drop exponentially. When the application is started directly without mounting mfs, the application start can be completed within 20s, which means that the reason why tomcat starts very slowly is caused by scanning the mfs directory. Unfortunately, there is no proper solution. Tomcat 7 has tested various configurations of skipping scans, and none of them are valid. There are currently two solutions.

  1. Delay mount mfs, let tomcat start first
  2. The mfs mount directory is placed outside WEB-INF

Guess you like

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