What is the best practice to scale a node app on Heroku?
When should I increase dynos, when workers?
The Heroku website says
Crank your web dynos to increase HTTP performance.
Crank your worker dynos to empty the queue faster.
I am not quite sure what that means for my node app.
Web dynos are like spawning a new instance for the server and Heroku does load balancing between them. This will speed up things when you are handling thousand of concurrent connections in the same time (or more), for example.
Worker dynos are used when you need to do background jobs (that are usually stored in a queue), such as sending emails, doing cronjobs or even handling big upload files. You want the web dynos to handle the web stuff (handling post requests, logging users etc), while worker dynos will do the “heavy lifting”, so that your main app won’t get slowed down by this (keep the event loop from blocking).