Tomcat's working mode

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.