Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Procfile? and Web and Worker

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.

like image 704
Maulik Suchak Avatar asked Apr 21 '13 05:04

Maulik Suchak


People also ask

What is Heroku worker?

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.

What is a Procfile Python?

Procfile is a Process file that is required for all Heroku applications. Procfile specifies the commands that are executed by the app on startup.

What is Procfile in Ruby on Rails?

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.

What are process types in Heroku?

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.


1 Answers

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.

like image 196
Michelle Tilley Avatar answered Oct 12 '22 23:10

Michelle Tilley