K
K
krumza2016-08-04 11:22:50
Node.js
krumza, 2016-08-04 11:22:50

How to make a common timer for all Node.js processes?

I use pm2 for daemonization and clustering.
I run pm2 start app.js -i 88 copies of the process on 8 cores.
There was a need to use a common timer loop for all processes.
Is it even possible to do this with pm2? How to enter into the database?
Or redo the entire architecture through Cluster?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
napa3um, 2016-08-04
@krumza

pm2.keymetrics.io/docs/usage/pm2-api/#send-message...
Or a simpler and more convenient option:
https://github.com/pm2-hive/pm2-intercom

D
Dmitry Belyaev, 2016-08-04
@bingo347

One timer process makes publish in redis
The rest, by subscribe, catch this notification and do their own logic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question