Pm2: Can't hide axm:monitor from logs

Created on 10 Jun 2018  ยท  10Comments  ยท  Source: Unitech/pm2

Hello. I'd like to disable logs like that:

0|node-fro | 2018-06-10 15:55:07.543    app:master:info pid:85088       Message from worker (85099): axm:monitor: payload: undefined

My config:

{
    "name": "node-frontback",
    "script": "server/server.js",
    "env": {
        "APP_ENV": "testing",
        "NODE_ENV": "production",
        "NODE_PATH": "."
    },
    "node_args": [
        "--use_strict",
        "--optimize_for_size"
    ],
    "watch": false
}

Starting like that:

pm2 start frontback.testing.json --no-pmx

But I continue to see such records in the log :/

$ pm2 report
===============================================================================
--- PM2 REPORT (Sun Jun 10 2018 16:00:45 GMT+0300 (Moscow Standard Time)) -----
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 2.10.4
node version         : 10.4.0
node path            : /data1/users/node-frontback/.nvm/versions/node/v10.4.0/bin/pm2
argv                 : /data1/users/node-frontback/.nvm/versions/node/v10.4.0/bin/node,/data1/users/node-frontback/.nvm/versions/node/v10.4.0/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : node-frontback
uid                  : 1010
gid                  : 1010
uptime               : 18min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 2.10.4
node version         : 10.4.0
node path            : /data1/users/node-frontback/.nvm/versions/node/v10.4.0/bin/pm2
argv                 : /data1/users/node-frontback/.nvm/versions/node/v10.4.0/bin/node,/data1/users/node-frontback/.nvm/versions/node/v10.4.0/bin/pm2,report
argv0                : node
user                 : node-frontback
uid                  : 1010
gid                  : 1010
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : freebsd
type                 : FreeBSD
cpus                 : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
cpus nb              : 8
freemem              : 1591435264
totalmem             : 17059672064
home                 : /data1/users/node-frontback
===============================================================================
--- PM2 list -----------------------------------------------
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ App name       โ”‚ id โ”‚ mode โ”‚ pid   โ”‚ status โ”‚ restart โ”‚ uptime โ”‚ cpu โ”‚ mem       โ”‚ user           โ”‚ watching โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ node-frontback โ”‚ 0  โ”‚ fork โ”‚ 85088 โ”‚ online โ”‚ 0       โ”‚ 13m    โ”‚ 0%  โ”‚ 56.9 MB   โ”‚ node-frontback โ”‚ disabled โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
===============================================================================
--- Daemon logs --------------------------------------------
/data1/users/node-frontback/.pm2/pm2.log last 20 lines:
PM2        | [2018-06-10 15:42:04] PM2 log: Time                 : Sun Jun 10 2018 15:42:04 GMT+0300 (Moscow Standard Time)
PM2        | [2018-06-10 15:42:04] PM2 log: PM2 version          : 2.10.4
PM2        | [2018-06-10 15:42:04] PM2 log: Node.js version      : 10.4.0
PM2        | [2018-06-10 15:42:04] PM2 log: Current arch         : x64
PM2        | [2018-06-10 15:42:04] PM2 log: PM2 home             : /data1/users/node-frontback/.pm2
PM2        | [2018-06-10 15:42:04] PM2 log: PM2 PID file         : /data1/users/node-frontback/.pm2/pm2.pid
PM2        | [2018-06-10 15:42:04] PM2 log: RPC socket file      : /data1/users/node-frontback/.pm2/rpc.sock
PM2        | [2018-06-10 15:42:04] PM2 log: BUS socket file      : /data1/users/node-frontback/.pm2/pub.sock
PM2        | [2018-06-10 15:42:04] PM2 log: Application log path : /data1/users/node-frontback/.pm2/logs
PM2        | [2018-06-10 15:42:04] PM2 log: Process dump file    : /data1/users/node-frontback/.pm2/dump.pm2
PM2        | [2018-06-10 15:42:04] PM2 log: Concurrent actions   : 2
PM2        | [2018-06-10 15:42:04] PM2 log: SIGTERM timeout      : 1600
PM2        | [2018-06-10 15:42:04] PM2 log: ===============================================================================
PM2        | [2018-06-10 15:43:50] PM2 log: Starting execution sequence in -fork mode- for app name:node-frontback id:0
PM2        | [2018-06-10 15:43:50] PM2 log: App name:node-frontback id:0 online
PM2        | [2018-06-10 15:46:47] PM2 log: Stopping app:node-frontback id:0
PM2        | [2018-06-10 15:46:47] PM2 log: App [node-frontback] with id [0] and pid [84839], exited with code [0] via signal [SIGINT]
PM2        | [2018-06-10 15:46:47] PM2 log: pid=84839 msg=process killed
PM2        | [2018-06-10 15:47:01] PM2 log: Starting execution sequence in -fork mode- for app name:node-frontback id:0
PM2        | [2018-06-10 15:47:01] PM2 log: App name:node-frontback id:0 online

Most helpful comment

Ok you can try in your config file :

{
  apps: [
    {
      name: 'fifawc2018',
      script: './build/main.js',
      env: {
        NODE_ENV: "production"
      },
      "pmx": false
    }
  ]
}

All 10 comments

How to disable "axm:monitor"?
Because of it, the local monitor hangs after 3 minutes of use and loads the CPU at 100%.

Hi @ixax

In theory axm:monitor is sent by pmx each seconds.
If you do not use pmx.probe() anywhere it should not send any axm:monitor message.

Could you try to launch your app with in debug mode ? Maybe it will provide some messages.

How to disable "axm:monitor"?

--no-pmx should do the trick.

@wallet77

pm2 start ecosystem.config.js --no-pmx
module.exports = {
  apps: [
    {
      name: 'fifawc2018',
      script: './build/main.js',
      env: {
        NODE_ENV: "production"
      }
    }
  ]
};

this command did not turn off axm:monitor.
what am I doing wrong?

@fenixphp It should work !
Did you test with your script only ?
pm2 start ./build/main.js --no-pmx

I've just made a test with a basic script and it works.

@wallet77
Yes, it works. but as it is repeated with the file ecosystem.config.js ?

Indeed there is a bug with config file. It seems args are not taking into account !
I will try to fix this.

Ok .. thanks.

Ok you can try in your config file :

{
  apps: [
    {
      name: 'fifawc2018',
      script: './build/main.js',
      env: {
        NODE_ENV: "production"
      },
      "pmx": false
    }
  ]
}

Everything worked. Thank you very much.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chaos-git picture chaos-git  ยท  3Comments

phra picture phra  ยท  3Comments

rangercyh picture rangercyh  ยท  4Comments

jubairsaidi picture jubairsaidi  ยท  3Comments

ldarren picture ldarren  ยท  3Comments