Reputation: 2161
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:
Upvotes: 6
Views: 4285
Reputation: 5556
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.
Upvotes: 7