N
N
Nicholas2016-02-19 09:45:57
Node.js
Nicholas, 2016-02-19 09:45:57

How to make a global variable in cluster mode in Node JS pm2?

I run applications pm2 start app.js -i 4 in four instances, 1 per core,
how do I make a shared variable for them?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2016-02-19
@bingo347

Each instance is a separate process with its own memory.
Look towards redis

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question