I subscribed a Hobby plan in Heroku.
The details of the plan specifies that it allows up to 10 Process Types.
So I developed an app with the following Procfile:
backend-dev: node ./backend-dev/backend.js
backend-prod: node ./backend-prod/backend.js
Which represents 2 Process Types, right ?
But when I run it with:
heroku ps:scale backend-dev=1
heroku ps:scale backend-prod=1
I end up with two Hobby Dynos... As the plan also specifies 7€/month/Dyno I am billed 14€/month.
So my questions are:
There are three primary process types: Web dynos: receive HTTP traffic from routers and typically run web servers. Worker dynos: execute anything else, such as background jobs, queuing systems, and timed jobs. One-off dynos: are temporary and not part of an ongoing dyno formation.
As explained in Heroku's docs, Dynos are simply lightweight Linux containers dedicated to running your application processes. At the most basic level, a newly deployed app to Heroku will be supported by one Dyno for running web processes.
Dyno's type is related with the capability of processing and the amount of memory that your dyno will have. The existing types are: free, hobby, standard-1x, standard-2x, performance-m, and performance-l. Each type has different features.
Default Scaling Limits By default, applications are limited to 100 total dynos across all process types. Apps running on eco , free , or hobby dynos can have only one dyno running per process type. Apps running on eco or free dynos are limited to a maximum of two concurrently running dynos.
Consider this simple example of web application with background worker, so it has web
process and worker
process. When such app receives a lot of web traffic, but processes very few background jobs, you can increase the number of dynos for your web
process, but have only one dyno for worker
process. It is also possible to have different dyno size per process. Instead of using more dynos, you can use performance-l dyno for web
process and standard-1x for worker
process. In other words, Process Types describe different processes that are working together within one application. They are not supposed to be different applications like in your case.
No. You can run one Process Type on multiple dynos.
Technically you can run one process on free dyno and another on hobby, but it won't work in your case. When you upgrade to professional dynos, then all processes must run on professional dynos.
Your Procfile
is all wrong. You must have Process Type name web
to receive web traffic. If you start your current setup, you will be running two processes, but they will never receive any web requests. It is described in Heroku docs, only web
process can receive web traffic and you can only have one such process. So to run two versions of your app, you need to create two different Heroku applications. And ideally you should allow to configure your app via environmental variables so you can deploy the same code to both apps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With