简体   繁体   English

部署所有应用程序后,启动Tomcat的HTTP / HTTPS连接器

[英]Start Tomcat's HTTP/HTTPS connector after all the applications are deployed

Problem: 问题:

We have many applications in Tomcat and each one needs a lot of time to start. Tomcat中有许多应用程序,每个应用程序都需要很多时间才能启动。

During that time, if you make an HTTP request to the Tomcat port, it gets waiting till all the applications are fully started. 在此期间,如果您向Tomcat端口发出HTTP请求,它将等待所有应用程序完全启动。

As we have a load balancer that only checks Tomcat TCP connections, it is not smart enough to discard that Tomcat instance. 由于我们有一个仅检查Tomcat TCP连接的负载平衡器,因此丢弃该Tomcat实例还不够聪明。

Wanted solution: 想要的解决方案:

I would like to know how to start Tomcat so it starts to listen HTTP requests only after all applications are fully deployed. 我想知道如何启动Tomcat,以便仅在完全部署所有应用程序后才开始侦听HTTP请求。 In this way, the load balancer will notice that it is not possible to make a TCP connection and it will discard that Tomcat during that time. 这样,负载平衡器将注意到无法建立TCP连接,并且在此期间它将丢弃该Tomcat。

The tomcat wiki has a "how to" on this Tomcat维基对此有一个“如何”的建议

How do I make Tomcat startup faster? 如何使Tomcat启动更快?

In short: 简而言之:

  • Web app configuration Web应用程序配置
  • Remove unnecessary JARs 删除不必要的JAR
  • Exclude JARs from scanning 从扫描中排除JAR
  • Entropy Source configuration 熵源配置
  • Enable start of webapps in parallel with startStopThreads 与startStopThreads并行启用webapp的启动
  • Tweak memory parameters 调整内存参数
  • Trim the config files as much as possible. 尽可能修剪配置文件。 XML parsing is not cheap. XML解析并不便宜。 The less there is to parse - the faster things will go. 要解析的内容越少-事情就会越快。
  • Remove any web applications that you do not need. 删除不需要的任何Web应用程序。 (So remove the all the web applications installed with tomcat) (因此,删除所有与tomcat一起安装的Web应用程序)
  • Make sure your code is not doing slow things. 确保您的代码没有做慢的事情。 (Use a profiler) (使用分析器)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何同时启动在Tomcat中部署的所有应用程序 - How to start all applications deployed in tomcat Concurrently Spring 在 https 后启动:配置为侦听端口 8443 的 Tomcat 连接器无法启动 - Spring boot after https: The Tomcat connector configured to listen on port 8443 failed to start https 后的 Spring 启动:配置为侦听端口 8444 的 Tomcat 连接器启动失败。 - Spring boot after https: The Tomcat connector configured to listen on port 8444 failed to start. 如何启动和停止部署在 tomcat 嵌入式服务器中的应用程序 - How I can start and stop applications deployed in a tomcat embedded server 在tomcat + jsf中的https之后重定向到http返回 - redirect to http back after https in tomcat + jsf Tomcat的HTTP连接器的maxPostSize的目的是什么? - What's the purpose of the maxPostSize for Tomcat's HTTP Connector? 部署在 Tomcat 上的应用程序的性能问题 - Performance issues with applications deployed on Tomcat 以编程方式在JSP中获取Tomcat HTTP Connector的maxPostSize - Programmatically get Tomcat HTTP Connector's maxPostSize in a JSP 在JSP中以编程方式获取Tomcat8 HTTP连接器的maxPostSize - Programmatically get Tomcat8 HTTP Connector's maxPostSize in a JSP 部署但上下文无法从tomcat 8开始 - deployed but context failed to start with tomcat 8
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM