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

pm2 cluster mode uses max cpus #8929

Merged
merged 2 commits into from
Sep 29, 2023
Merged

pm2 cluster mode uses max cpus #8929

merged 2 commits into from
Sep 29, 2023

Conversation

arelra
Copy link
Member

@arelra arelra commented Sep 27, 2023

What does this change?

Following #8789 we can try running pm2 in cluster mode.

This PR sets the number of worker processes equal to the max number of cpus available.

This would increase the available cpus from 1 to 2 for our prod instance size of t4g.small.

Why?

Improve request latency and cpu utilisation of our instances.

Before

dotcom-+    1366  17:08   1:07 node /home/dotcom-rendering/rendering/dist/server.js

After

dotcom-+    1404  14:47   0:04 node /home/dotcom-rendering/rendering/dist/server.js
dotcom-+    1413  14:47   0:08 node /home/dotcom-rendering/rendering/dist/server.js

@arelra arelra requested a review from a team as a code owner September 27, 2023 16:09
@github-actions
Copy link

github-actions bot commented Sep 27, 2023

Size Change: 0 B 🆕

Total Size: 0 B

compressed-size-action

Copy link
Contributor

@georgeblahblah georgeblahblah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So exciting!

From a PR perspective, I think you might need to rebase against main to bring in the changes which make the AR CI build job for the required status check run.

@arelra arelra added the run_chromatic Runs chromatic when label is applied label Sep 28, 2023
Copy link
Member

@AshCorr AshCorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not totally convinced on PM2 yet, I find its lack of response to the AGPL question to be quite alarming and would prefer to find an alternative "process manager" if possible. But since we are using PM2 it seems a waste to not make use of our extra compute power! Good PR!

@arelra
Copy link
Member Author

arelra commented Sep 28, 2023

I'm not totally convinced on PM2 yet, I find its lack of response to the AGPL question to be quite alarming and would prefer to find an alternative "process manager" if possible. But since we are using PM2 it seems a waste to not make use of our extra compute power! Good PR!

I agree we should look for alternatives. Although pm2 is very mature the infrequent updates are concerning too.

Have suggested some next steps here.

In the mean time given cluster mode is easy to switch on, it will be interesting to see how it performs for us.

@arelra arelra merged commit 8d8c527 into main Sep 29, 2023
@arelra arelra deleted the ravi/pm2-cluster-mode branch September 29, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotcom-rendering run_chromatic Runs chromatic when label is applied
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants