Does Apache Tomcat start a new process for each deployed WAR?

瘦欲@ 提交于 2019-12-12 22:17:12

问题


When I deploy (and start) two WAR files on one Tomcat instance, how many Java processes will there be? In other words, will the threads handeling requests to the respective context roots fall under the same process, or will each thread pool fall under a sparate process?


回答1:


The Tomcat application server deploys all webapps into a single JVM by default.

However you can have multiple tomcat instances which can run their own JVM and have separate configurations and can be started/stopped independently.

Tomcat has had the ability to define and run multiple instances from a single copy of a binary distribution, and this functionality is well documented in the file RUNNING.txt at the root of the Tomcat binary distribution file hierarchy

Source

RUNNING.TXT example

Run multiple tomcat instances example




回答2:


From what I know there is a thread pool created per Connector. Although, you can implement an Executor, which will allow to share a thread pool. The Executor element has to appear prior to Connector element in server.xml



来源:https://stackoverflow.com/questions/30081831/does-apache-tomcat-start-a-new-process-for-each-deployed-war

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!