12/15/14

Keeping Heroku Apps Awake

I host my rails apps on Heroku, which is an awesome service.
It was becoming a problem though, that after an hour of disuse the apps would go into idle mode. When an app is idling, the time to start it up again ranges from 8 - 15 seconds, at which point many users would just give up and click elsewhere.

I fixed this by installing a Heroku add-on called Scheduler. This add-on makes it possible to carry out tasks periodically. I then wrote a rake command that sent a GET request to all of my apps, keeping them from idling.

Lessons Learned:

  1. Difference between web and worker dynos
  2. Building custom rake tasks
  3. Heroku add-ons




No comments:

Post a Comment