tomcat启动扫描导致启动过慢

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测试了各种跳过扫描的配置,没一个生效可用 目前有两个解决办法

  1. 延迟挂载mfs,让tomcat先启动
  2. mfs挂载目录放到WEB-INF之外

转载于:https://my.oschina.net/xueyi28/blog/1802604

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值