前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >tomcat启动扫描导致启动过慢 原

tomcat启动扫描导致启动过慢 原

作者头像
domain0
发布2018-08-01 18:24:42
6660
发布2018-08-01 18:24:42
举报
文章被收录于专栏:运维一切运维一切

tomcat在启动的时候每次到这个地方都要等待很长时间

代码语言:javascript
复制
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

代码语言:javascript
复制
/data/www/app/latest/WEB-INF/uploads

mfs的文件总量19GB左右,全量扫描一次如果在同一机房需要5-10分钟,如果不在同一机房,速度按理为指数级下降。 当不挂载mfs直接启动应用,应用启动在20s内就可以完成,也就是说tomcat启动很慢的原因是扫描了mfs目录引起的。 不过很遗憾,没有比较妥善的解决办法,tomcat7测试了各种跳过扫描的配置,没一个生效可用 目前有两个解决办法

  1. 延迟挂载mfs,让tomcat先启动
  2. mfs挂载目录放到WEB-INF之外
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档