The relationship between JVM and Tomcat

Recently doing micro-projects related service deployment, container used for the Tom Cat tomcat, through the process of exchange and architects as well as their own understanding come to a few key messages

Here recorded.

The relationship between the JVM and tomcat, from several directions described below:

1, JVM, java virtual machine, different operating platform java application equipment.

2, Tomcat, apache free open source web application server, the java language, in other words: tomcat is also a java application.

-------- easy to see where to start tomcat container is inseparable from the JVM

3, JVM to some extent can be thought of as a virtual operating system, which has its own memory model and so on;

4, start a tomcat container, the equivalent of a process initiated in the JVM;

5, a tomcat container can launch multiple web app these is as the process launched multiple threads. (By specifying multiple context in server.xml)

6, each process has its own separate memory space, inter-process communication more difficult;

7, while threads in the process to start, will not allocate additional memory space, in other words: multiple threads share memory space in the process, so that the communication more convenient and fast.

 

Another think is: webUI service in java code whether there is need to exist? ?

Modern micro-service architecture, tomcat container is a thick web container, start a micro-services equivalent to adding a node deployment process on the JVM, which is bound to bring some memory overhead;

For micro-services webUI nature, it is proposed to retain only pure static files (javascript, css, gif, etc.), and the deployment of vessels to choose more lightweight nginx; and in the overall deployment plan, the deployment of such services on the same node

Guess you like

Origin www.cnblogs.com/sniffs/p/12002733.html