It is OK and I can see the 8 workers but when I console like below, I see only worker id 8 and sometimes 6. What happened?
router.get("/", (req, res) => {
logger.info(`cluster.worker.id ${cluster.worker.id}`);
}It is my entry point.
https://gist.github.com/mohammadmahdi123/e6e32210a530aa496a631d51e65674a5
I expect to see all workers not some of them
I test it with artillery
$ artillery quick --count 10000 -n 1 http://localhost:3000
it randomly assigns the request to each worker
Why not pm2?
Обсуждают сегодня