as a servlet container, Tomcat has 3 modes of operation: a standalone servlet container, a servlet container within the process, and an out-of-process servlet container.
1. Stand-alone servlet container
The standalone servlet container is the default mode for Tomcat. In this mode, Tomcat can act as a standalone Java Web server, and the servlet container exists as part of the Web server.
2. In-process servlet container
When Tomcat acts as a servlet container within a process, the servlet container is the implementation of the plug-in and Java container as a Web server.
The Web server plug-in opens a JVM (Java Virtual Machine) in the internal address space to enable the Java container to run internally. If there is a request to invoke the servlet, the plug-in will take control of the request and pass it (using JNI) to the Java container. In-process containers are ideal for multi-threaded, single-threaded servers, and provide a good run speed, but with insufficient scalability.
Note: JNI is a shorthand for Java Native Interface, which is a Java native calling interface. Through this interface, Java programs can communicate with local programs written in other languages.
3. Out-of-process servlet container
When Tomcat acts as an out-of-process servlet container, the servlet container runs in an address space outside the Web server and is combined as a Web server's plug-in and implementation of the Java container.
The Web server plug-in and the Java container JVM communicate using the IPC mechanism (usually TCP/IP). When a request to the servlet arrives, the plug-in takes control of the request and passes it (using IPC, etc.) to the Java container, the reaction time of the out-of-process container or the out-of-process container engine is inferior to the process content device, but the out-of-process container engine is better in many other comparable areas (such as scalability,
Note :IPC is a shorthand for interprocess communication (interprocess communication), which is a technology for interprocess communication.
Tomcat can be used as a stand-alone container (primarily for development and debugging) and as an addition to existing servers (Apache, IIS, and Netscape servers are currently supported).
Tomcat's working mode