When "PM2_CONCURRENT_ACTIONS=16 pm2 reload" is run, launch the new processes simultaneously, but kill the old processes in sequenece
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
What's going wrong?
When running e.g. PM2_CONCURRENT_ACTIONS=16 pm2 reload, pm2 spawns the new 16 cluster workers simultaneously and then kills the old 16 workers more or less simultaneously too, thus producing a thundering herd issue: all the clients (with long lived WS connections) got disconnected at the same time and then reconnected to the new workers at the same time too.
Would be cool to have the mode when the new workers are still spawned simultaneously (i.e. the new cluster is brought up), but then, the old workers are retired slowly, sequentially. In this case, the thundering herd would still land on the new workers (because they're ready at that time), but it would be spread in time.
How could we reproduce this issue?
PM2_CONCURRENT_ACTIONS=16 pm2 reload
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the reload path used by PM2_CONCURRENT_ACTIONS=16 pm2 reload, especially how new cluster workers are started and old workers are retired. Done means new workers still launch concurrently while old workers are stopped sequentially, avoiding simultaneous long-lived connection drops.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100