Ollie Glass
Ollie Glass

Reputation: 19993

Heroku worker only app

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.

Upvotes: 12

Views: 3864

Answers (2)

Franklin Yu
Franklin Yu

Reputation: 9958

If you are looking for cron-like tasks for simple jobs (like I am), now you have another alternative: Heroku Scheduler. It is easy to configure in a dashboard.

Scheduler dashboard

Advantage:

  • No need to choose and learn a new scheduler library. Configure it in seconds.
  • Same way for different platforms: Python, Ruby, etc.
  • Save Dyno Hours for Free Plan user. Only the actual working time counts. Some scheduler library (like Rufus Scheduler) will keep running between launches (so that it does not rely on cron to work).

Disadvantage:

  • Trivial options. You can only choose among "Daily"/"Hourly"/"Every 10 minutes".

Conclusion: Best for basic use.

Upvotes: 2

Yuval Adam
Yuval Adam

Reputation: 165340

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/

Upvotes: 8

Related Questions