pm2 doesn't run with multiple cores

Created on 3 Feb 2016  路  7Comments  路  Source: Unitech/pm2

I have a multiple cores ubuntu:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 2
....

when running:
pm2 start app.js -i 4

I see only one running,
no error

Most helpful comment

Actually I take that back. I had originally started with "pm2 start app.js" - and though I had stopped via "pm2 stop 0" - I had not actually _deleted_ that original process.

Doing "pm2 delete all" and then "pm2 start app.js -i 0" created a cluster of 8 processes for me.

@benag I bet this is the issue you are having.

All 7 comments

pm2 version?

pm2 start server.js -i 4 launches 4 processes, it doesn't mean that they won't run in the same core.

screenshot from 2016-02-03 15 38 59

doesnt work i get only one line in the table..

Please do: node -e "var os = require('os'); console.log(os.cpus())"

I'm experiencing the same issue. Here is the cpu info:

[ { model: 'Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz',
speed: 2500,
times:
{ user: 6762800,
nice: 311800,
sys: 571500,
idle: 1699312200,
irq: 0 } },
{ model: 'Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz',
speed: 2500,
times:
{ user: 6320300,
nice: 140000,
sys: 542200,
idle: 1699794800,
irq: 0 } } ]

I see the same behavior with 1.0.2: using -i 0 to get the max or using -i 4 to try 4 does not work for me. I get a single process running in 'fork_mode'

This is how node sees my cpus:

[ { model: 'Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz',
speed: 2000,
times: { user: 17580550, nice: 0, sys: 20561050, idle: 86157080, irq: 0 } },
{ model: 'Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz',
speed: 2000,
times: { user: 1717310, nice: 0, sys: 2091070, idle: 120485570, irq: 0 } },
{ model: 'Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz',
speed: 2000,
times: { user: 15956130, nice: 0, sys: 15347480, idle: 92992280, irq: 0 } },
{ model: 'Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz',
speed: 2000,
times: { user: 1755730, nice: 0, sys: 2124360, idle: 120413240, irq: 0 } },
{ model: 'Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz',
speed: 2000,
times: { user: 15993680, nice: 0, sys: 15404580, idle: 92896960, irq: 0 } },
{ model: 'Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz',
speed: 2000,
times: { user: 1765580, nice: 0, sys: 2138390, idle: 120388800, irq: 0 } },
{ model: 'Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz',
speed: 2000,
times: { user: 15961750, nice: 0, sys: 15328160, idle: 93004660, irq: 0 } },
{ model: 'Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz',
speed: 2000,
times: { user: 1763620, nice: 0, sys: 2128860, idle: 120399750, irq: 0 } } ]

Actually I take that back. I had originally started with "pm2 start app.js" - and though I had stopped via "pm2 stop 0" - I had not actually _deleted_ that original process.

Doing "pm2 delete all" and then "pm2 start app.js -i 0" created a cluster of 8 processes for me.

@benag I bet this is the issue you are having.

probably

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ldarren picture ldarren  路  3Comments

xzycn picture xzycn  路  3Comments

rangercyh picture rangercyh  路  4Comments

getvega picture getvega  路  3Comments

lefam picture lefam  路  3Comments