Unitech / Unitech/pm2

cluster: can't transition to max/-1 without downtime

Open
#4,942 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

If I change my number of instances through the instances config or the -i flag, pm2 reload will not automatically scale to the new number of instances. Neither will restart. That appears to be by design.

pm2 scale does not appear to have any understanding of how many processors there are. I am able to pm2 scale <app> +1 past my number of processors.

pm2 scale 'max' or pm2 scale '-1' also doesn't appear to be implemented.

So it appears that if I want to change my clustering setup to use max or -1, the only way I can do so is to actually delete and restart my app, leading to downtime.

Can this be made more graceful? Perhaps by adding an option to restart/reload to pay attention to the instance value, or by adding a pm2 scale max/-1 option?

(Currently using pm2 4.4.1)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pm2 scale, reload, and restart CLI entry points, then reproduce the behavior using the instances config or -i flag. Done means changing to max or -1, or an equivalent reload/restart option, adjusts the cluster without deleting the app or causing downtime.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.