9

I'm trying to keep my Heroku (free) application awake during daytime. I don't really care if it sleeps late at night.

The old technique of continuously pinging the app is no longer a valid solution because since 2015, all free-app's have to sleep at least 6 hours a day.

I'd like to know if any of you guys figured this out before.

I need to schedule the recharge state or maintenance mode in a specific time range.

Let's make this question and an up-to-date resource of accomplishing this task.

Please submit only constructive ideas.

2 Answers 2

7

You can just scale it down for the six hours you want it to be asleep:

heroku scale web=0

Then scale it back up when you want to wake it up:

heroku scale web=1

There are a lot of ways to implement this; a script on some other machine would work fine, but you could probably also use the Heroku Platform API and a scheduler service:

disclosure: I'm the Node.js Platform Owner at Heroku

1
  • 1
    This is just... epic. I really admire you, man. Btw... am I going to jail for this? Jul 25, 2015 at 22:44
5

There is also this add-on: https://devcenter.heroku.com/articles/process-scheduler

At first I thought it wasn't working as it doesn't seem to necessarily run right at the top of the hour, but other than that it's been working really well for me and allows me to sleep my app overnight.

1
  • Nice! Sounds like a perfect fit for this use case. I wasn't aware of that addon. Aug 10, 2015 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.