D
D
Denis Kuznetsov2021-08-14 16:36:01
Java
Denis Kuznetsov, 2021-08-14 16:36:01

How do the application process and the server process work?

Hello, I have such a theoretical question: the
Spring boot application has a built-in tomcat server under it, on which it runs,
you can also run your own tomcat server and deploy several war archives with different applications on it, let's say on bare servlets.
Each spring application runs on its own port and has its own separate process, and if you run several applications, will there be several application processes and several processes of running tomcat servers?
And applications running on one server, as in the second case, go as one process and have one port? Or are they also different processes, but one server process?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2021-08-14
@DennisKingsman

Only one process can hang on one port (the exceptions are the introduction into the TCP / IP stack, as firewalls do, but there is another story)
Accordingly, you either run several war applications inside the tomcat application server, and sort them either by ports or by endpoints , but all these ports belong to one tomcat, or each springboot launches its own (but it hardly makes sense to use tomcat in this case, it's easier to use a lightweight jetty), and each one already occupies its own port
. That is, one application can listen to several ports.
But each one port can be listened to by only one application.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question