Sunday, August 10, 2014


One of the main problem on hosting your web applications in Heroku is "idling". Idling is when your web dynos will go down after not having a single visit or connection in 1 hour span.

The solution for this is very easy, just ping your app. But what is the effective or cheapest way of doing it?

As of now, I do have at least 5 web apps hosted in Heroku and at first I am having a hard time on keeping my apps from idling. Here's how I ping my apps simultaneously:


  1. Sign up to SetCronJob.com
  2. Create a php file with this code inside:
    • <?php
      file_get_contents('your_website_here');
      file_get_contents('your_website_here');
      file_get_contents('your_website_here');
      file_get_contents('your_website_here');
      ....
      and so on 
  3. Back to SetCronJob, create a job with 30 minutes pattern
  4. Paste your app url along with the php file you created : sampleapp.herokuapp.com/cron.php
  5. Hit save
That's it!!

Unfortunate for me, I found a very late solution to my problem. You can also use New Relic's monitoring capability to ping your website.  Using SetCronJob only allows you to ping your website for every 30 minutes because of account limitation but here in New Relic it seems every minute it pings your apps. 

Same process but instead of using SetCronJob you can paste your cron url in New Relic's monitoring page.


1 comment:

  1. https://www.easycron.com provides a free plan which allows setting webcron with "10 minutes" minimum interval.

    ReplyDelete