Is it necessary to give 'worker' information in Procfile? If yes then what it is actually? I have already added web: node server/server.js
detail in the Procfile
.
Dyno configurations Worker: Worker dynos can be of any process type declared in your Procfile, other than “web”. Worker dynos are typically used for background jobs, queueing systems, and timed jobs. You can have multiple kinds of worker dynos in your application.
Procfile is a Process file that is required for all Heroku applications. Procfile specifies the commands that are executed by the app on startup.
At it simplest, the Procfile is where you declare the one or more processes to be run for your app to function. Heroku's docs do a great job of explaining the Procfile format, so this post will focus on a bit more advanced usage.
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.
Procfile is a mechanism for declaring what commands are run by your application’s dynos on the Heroku platform.
From Process Types and the Procfile, which is a good introduction, but basically you use the Procfile to tell Heroku how to run various pieces of your app. The part to the left of the colon on each line is the process type; the part on the right is the command to run to start that process.
Process types can be anything, although web
is special, as Heroku will route HTTP requests to processes started with the web
name. Other processes, such as background workers, can be named anything, and you can use the Heroku toolbelt to start or stop those processes by referring to its name.
So, in short, worker
is not necessary, unless you want to run some other process in the background by controlling process with the heroku ps
command.
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