Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of pm2 _and_ cluster #5

Open
alexd-jht opened this issue Mar 8, 2021 · 0 comments
Open

usage of pm2 _and_ cluster #5

alexd-jht opened this issue Mar 8, 2021 · 0 comments

Comments

@alexd-jht
Copy link

Hi there,

First of all, thanks for your blog post here. It's been very valuable example for communicating with my team.

In this project, cluster.fork(); is used to duplicate your process numCPUs times. Then in the blog post, you mention pm2 start dist/main.js -i max, where this also creates the process numCPUs times. When applying both, wouldn't one be creating numCPUs^2 processes if you were to use clusterize and pm2 -i max?

Well, spoiler alert :) it doesn't create that many processes. In my experiment, if you run with pm2 cluster mode, it seems like the AppClusterService doesn't do anything. I'm trying to figure out why that is. In any case, with pm2, it seems like you can safely remove AppClusterService

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant