Unitech / Unitech/pm2

Memory Limit Reload does not log to pm2 logs

Open
#4,857 2 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

What's going wrong?

The PM2 'Max Memory Threshold Auto Reload' was killing an application which had exceeded the limit, but from pm2 logs there was no clear way of telling this. The application simply 'died' and restarted, without logging anything to console.

How could we reproduce this issue?

  1. Set the max_memory_restart of an application to some value.
  2. Create a Node application that exceeds that limit.
  3. Observe no logging takes place when the application exceeds it.

Supporting information

$ pm2 report

--- PM2 report ----------------------------------------------------------------
Date                 : Mon Sep 21 2020 13:39:53 GMT+0200 (Central European Summer Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 3.5.1
node version         : 10.15.0
node path            : not found
argv                 : /usr/bin/node,/usr/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : codefined
uid                  : 1000
gid                  : 1000
uptime               : 137815min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 3.5.1
node version         : 10.15.0
node path            : /usr/bin/pm2
argv                 : /usr/bin/node,/usr/bin/pm2,report
argv0                : node
user                 : codefined
uid                  : 1000
gid                  : 1000
===============================================================================

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 by reproducing the issue with an application configured with max_memory_restart, then inspect the memory-threshold restart path and the output of pm2 logs. Done means that exceeding the limit produces a clear log entry explaining the automatic kill and restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.