Apache Tomcat 是否为每个部署的 WAR 启动一个新进程?
Does Apache Tomcat start a new process for each deployed WAR?
当我在一个 Tomcat 实例上部署(并启动)两个 WAR 文件时,会有多少个 Java 进程?换句话说,将请求处理到各个上下文根的线程是否属于同一进程,或者每个线程池是否属于不同的进程?
Tomcat 应用程序服务器默认将所有 webapps 部署到一个 JVM 中。
但是,您可以拥有多个 tomcat 个实例,这些实例可以 运行 它们自己的 JVM 并具有单独的配置,并且可以 started/stopped 独立。
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
据我所知,每个连接器都创建了一个线程池。虽然,您可以实现一个 Executor,这将允许共享一个线程池。在 server.xml
中,Executor 元素必须出现在 Connector 元素之前
当我在一个 Tomcat 实例上部署(并启动)两个 WAR 文件时,会有多少个 Java 进程?换句话说,将请求处理到各个上下文根的线程是否属于同一进程,或者每个线程池是否属于不同的进程?
Tomcat 应用程序服务器默认将所有 webapps 部署到一个 JVM 中。
但是,您可以拥有多个 tomcat 个实例,这些实例可以 运行 它们自己的 JVM 并具有单独的配置,并且可以 started/stopped 独立。
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
据我所知,每个连接器都创建了一个线程池。虽然,您可以实现一个 Executor,这将允许共享一个线程池。在 server.xml
中,Executor 元素必须出现在 Connector 元素之前