verekia / js-stack-from-scratch

🛠️⚡ Step-by-step tutorial to build a modern JavaScript stack.
MIT License
20.09k stars 1.99k forks source link

Clustering Express Instances (not sure) #176

Open MaxiBoether opened 7 years ago

MaxiBoether commented 7 years ago

Type of issue: (feature suggestion, bug?)

Feature suggestion

Chapter:

I don't really know if this fits here as I am currently trying to learn JavaScript myself. I've read that you can make usage of multiple CPU cores by clustering your express instances (http://stackabuse.com/setting-up-a-node-js-cluster/). I don't know if that's still a good thing to do or if that's outdated information, but if it's still a valid technique then why not include it?

verekia commented 7 years ago

That was an interesting read, thank you :)

I think it would make more sense to rely on PM2 for that though, since we use it for production:

http://pm2.keymetrics.io/docs/usage/cluster-mode/

For Heroku that would be a bit different though:

https://devcenter.heroku.com/articles/node-concurrency

Not sure if clustering in general is necessary in the context of this tutorial. I could maybe just add a note about it.