PM2 Not Using Enough RAM
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?
Hi I'm running PM2 in cluster mode on a Heroku Performance-L instance (8 cores). I'm running 8 instances and have fantastic performance when the app first starts up. As time goes on PM2 decides to use less and less memory until the app starts to slow down. Wondering if the solution is to add more instances or get a different type of machine.
How could we reproduce this issue?
It happens every time I deploy to Heroku.
Supporting information
--- PM2 report ----------------------------------------------------------------
Date : Fri Jan 29 2021 21:51:04 GMT+0000 (Coordinated Universal Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 4.5.1
node version : 12.20.1
node path : /app/node_modules/.bin/pm2-runtime
argv : /app/.heroku/node/bin/node,/app/node_modules/.bin/pm2-runtime,start,ecosystem.config.js,--env,production
argv0 : node
user : undefined
uid : 5401
gid : 5401
uptime : 7min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 4.5.1
node version : 12.20.1
node path : /app/node_modules/.bin/pm2
argv : /app/.heroku/node/bin/node,/app/node_modules/.bin/pm2,report
argv0 : node
user : u5401
uid : 5401
gid : 5401
===============================================================================
--- System info --------------------------------------------
arch : x64
platform : linux
type : Linux
cpus : Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
cpus nb : 8
freemem : 215343104
totalmem : 15768866816
home : /app
===============================================================================
--- PM2 list -----------------------------------------------
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name │ mode │ ↺ │ status │ cpu │ memory │
├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
│ 0 │ app │ cluster │ 0 │ online │ 93.9% │ 1.3gb │
│ 1 │ app │ cluster │ 0 │ online │ 94.7% │ 1.3gb │
│ 2 │ app │ cluster │ 0 │ online │ 97.4% │ 1.3gb │
│ 3 │ app │ cluster │ 0 │ online │ 74.6% │ 1.3gb │
│ 4 │ app │ cluster │ 0 │ online │ 84.2% │ 1.4gb │
│ 5 │ app │ cluster │ 0 │ online │ 86.8% │ 1.4gb │
│ 6 │ app │ cluster │ 0 │ online │ 91.2% │ 1.4gb │
│ 7 │ app │ cluster │ 0 │ online │ 97.4% │ 1.4gb │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
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 with the supplied PM2 report and the Heroku deployment using ecosystem.config.js in cluster mode. Reproduce the reported decrease in memory use and slowing performance over time, then document or verify the cause and a confirmed remedy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100