Running Node.js App with cluster module is meaningless in Heroku?

大城市里の小女人 提交于 2019-12-01 17:48:25

I've found that it actually worth to use cluster module

because each dyno has 4 CPU cores.


Reference: http://www.quora.com/Heroku/How-powerful-is-one-Heroku-dyno

This is an old question, thought I should update to a more complete answer.

According to this table on their documentation

  • 1X Dynos have 1 cluster
  • 2X Dynos have 2 clusters
  • PX Dynos have 12 clusters

So, assuming that you are using 1X dynos, it won't be necessary to implement clusters. If you are using the other ones, it is a good idea to do so.

The number of clusters can be found on the WEB_CONCURRENCY environment variable.

That's very good news to me, i assumed that a dyno is just one core. I actually wrote and open sourced a small but very nicely made cluster setup (backed by redis and job queue)

https://bitbucket.org/jeveloper/nodejscluster

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!