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

后端 未结 3 1445
无人及你
无人及你 2021-01-19 01:59

Heroku can run

Web Dynos

and

Worker Dynos

so that Web Dynos take care of routes

and worker W

3条回答
  •  青春惊慌失措
    2021-01-19 02:21

    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.

提交回复
热议问题