tomcat在启动的时候每次到这个地方都要等待很长时间
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.
可以看到TLD scan居然花了24分钟之多 看了一圈资料 https://blog.csdn.net/renfufei/article/details/70878077 这玩意居然还会扫描两次 到底是什么原因导致的扫描如此的慢? 开始排除外部因素,启动之前不再挂载mfs
/data/www/app/latest/WEB-INF/uploads
mfs的文件总量19GB左右,全量扫描一次如果在同一机房需要5-10分钟,如果不在同一机房,速度按理为指数级下降。 当不挂载mfs直接启动应用,应用启动在20s内就可以完成,也就是说tomcat启动很慢的原因是扫描了mfs目录引起的。 不过很遗憾,没有比较妥善的解决办法,tomcat7测试了各种跳过扫描的配置,没一个生效可用 目前有两个解决办法
- 延迟挂载mfs,让tomcat先启动
- mfs挂载目录放到WEB-INF之外