I'm running a NodeJS based application, connected to mongohq-MongoDB, on a free Dyno. I'd like to migrate it to use the hobby Dyno and the motivation to do so is not only avoiding sleep-time, but also to enable higher HTTP traffic throughput.
Reading the Scaling documentation and the Procfile article got me confused about how scaling on Heroku should be done.
In the Procfile article, it is said that the web process type is the only process which will receive HTTP traffic from Heroku routing-mesh.
So my questions are:
- When there's already one hobby Dyno running, executing 'heroku ps:scale web+2' will result in having +2 web processes on the same Dyno or in adding two hobby Dynos (to a total of three hobby Dynos) ?
- Total of three hobby Dynos means 3 web processes and 27 non-web processes available ?
- In this answer, it is suggested to use the cluster module to fork threads to handle HTTP requests,How one can determine the # of workers that should be created (in the
// fork worker processes
loop)? - How should I decide when to scale my application horizontally (add more Dynos of the same type) of vertically (stronger Dynos like standard-1X/2X)
- Horizontal scale should be triggered to handle higher # of requests?
- Vertical scale should be triggered to handle heavier processing (more computational resources are in need to provide response to respective request?)
N.B,
In the Scaling section of this answer, the result Dynos is still not clear in respect to question #1 above.
Please take into consideration that application optimization (e.g. find/remove bottlenecks, etc...) is out of the scope of this question as the goal of it is to better our understanding of resource-utilization on Heroku platform.