M
M
mamont802018-09-02 08:47:29
Node.js
mamont80, 2018-09-02 08:47:29

How does pm2 start N application instances that are listening on the same port?

I would like to understand how PM2 works. PM2 launches, for example, 4 application instances and load balances between them. In this case, the port listens to the same one (3000 by default), the port number is hardcoded in the code, and is not taken from the environment. But there cannot be more than one application on the same port. PM2 itself generally does not know in advance which ports the application will use. How does he do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladlen Hellsite, 2018-09-02
@mamont80

This is not the merit of PM2, but of clusters .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question