6

Heroku can run

Web Dynos

and

Worker Dynos

so that Web Dynos take care of routes

and worker Worker Dynos take care of processing works.

Since there is a unit of Dyno,

It seems using Node.js cluster module is meaningless to me on Heroku.

Because Node.js cluster module is to use all cores of server CPU

and Dyno seems virtual unit of CPU core to me.

Am I right? Or is it still worth to run a node.js app with cluster module?

3 Answers 3

4

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

Sign up to request clarification or add additional context in comments.

1 Comment

Have you done any performance tests? Is it 4 times as fast or..?
1

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.

1 Comment

It's not X clusters, it's X cluster workers. You're still (probably) going to run a single cluster..
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.