Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku worker only app

Tags:

heroku

If I have an app on Heroku that consists of one worker and one or no web dynos, will it run? I'm unsure if the absent or idling web dynos will cause the worker dyno not to run.

like image 338
Ollie Glass Avatar asked Apr 09 '14 08:04

Ollie Glass


People also ask

What is worker on Heroku?

A separate app process (known on Heroku as a worker process) notices that a task was added to the job queue. It takes the task off of the queue and begins performing it. When the worker process completes the task, it persists the outcome of the task.

How do I temporarily disable Heroku app?

If you wish to stop a running one-off dyno, use heroku ps:stop with its name. A one-off dyno will not stop if you issue heroku ps:restart on your application.

What are the limitations of free Heroku?

free, hobby and standard-1x have 512 MB. standard-2x has 1024 MB. performance-m has 2.5 GB.

Do worker dynos sleep Heroku?

In addition to the web dyno sleeping, the worker dyno (if present) will also sleep. Free web dynos do not consume free dyno hours while sleeping. If a sleeping web dyno receives web traffic, it will become active again after a short delay (assuming your account has free dyno hours available).


1 Answers

Heroku doesn't just run web dynos, in fact, it makes no assumptions at all with regards to the processes you're running. There's absolutely nothing wrong with launching a single worker process.

This is actually a common scenario for me to deploy single cron-like tasks to Heroku, I've written about it here http://blog.y3xz.com/blog/2012/11/16/deploying-periodical-tasks-on-heroku/

like image 54
Yuval Adam Avatar answered Oct 09 '22 04:10

Yuval Adam