Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I build MVP's for clients regularly. Often I deploy on Heroku so they can see if the product works and demo it to prospects and investors.

Then I have an application deployed on heroku, and it works like a charm, if not for one little thing. The app takes about 30 seconds to start up and heroku has the annoying habit of killing dyno's if they don't get traffic. My client is using the application for demo purposes now, so the load is extremely low and intermittent.

I'm looking for a solution that is preferably:

  • cost effective
  • can be applied to multiple apps simultaneously

What is the best way to avoid having the first request taking 30 seconds?

share|improve this question
Re: your attempted edit to my answer, no, Pingdom has a free level of service. – ceejayoz Nov 4 '12 at 15:19
@ceejayoz ah, I must have missed that on their site they say 1 site 20 sms's is free... which is well, nice and all, but it's "free level of service" for varying values of free I guess. I'm not one to flame a freebee, but it's no more than that. – iwein Nov 4 '12 at 22:14
Based on your question, you only need the one site, and you don't really need the SMSes at all. – ceejayoz Nov 4 '12 at 22:42
@ceejayoz, you're right, but I thought I could make your answer more complete by mentioning other options than Pingdom. Nothing against the solution, but for my particular use case (which wasn't very clear in the question) it doesn't fly. I tried to reconstruct my edit (minus the error) and put it in my own answer. You can comment there or suggest edits if you still see a problem with the wording. – iwein Nov 5 '12 at 5:51
up vote 6 down vote accepted

Heroku now has a cron-equivalent add-on called Scheduler. Based on a tutorial:

  1. In app/lib/tasks, add a file named scheduler.rake with this task defined:

    desc "This task is called by the Heroku cron add-on"
    task :call_page => :environment do
       uri = URI.parse('')
  2. Add the "Scheduler" addon from your Heroku control panel or from the console:

    heroku addons:add scheduler:standard

  3. Configure Scheduler to run this task hourly.

    heroku addons:open scheduler

I suspect this is Heroku's preferred method, as a Heroku community rep demonstrated this technique at a talk.

share|improve this answer

Simple answer: You pay for it.

Ramp up to two dynos and your app will not idle.

If cost conscious then only ramp up to two web dynos for short periods of time around your client's demos. Heroku only charge $0.05 per hour.

Or drive frequent traffic to the app somehow so it does not idle. But Heroku offer such a great service that you use for free so why not throw them a few cents for the periods you need guaranteed response.

share|improve this answer
You're right of course, but with a lot of startups and a lot of apps for my clients this adds up (either mental overhead of scaling all those apps up and down, or in costs per month). The $35/m for two dynos doesn't do right by my usage pattern. I've found a nice hack btw:… – iwein Nov 2 '12 at 6:10

You can point a Pingdom check at your site's URL. As a bonus, you'll be keeping an eye on downtime while you do so.

share|improve this answer
Awesome! I'm looking at it right now :) Thanks. – Ragunath Jawahar Nov 19 '14 at 3:33

Using the New Relic monitoring service seems to be a good option...

How to in the following post:

Avoid Heroku idling with New Relic pings

share|improve this answer

It's in the FAQ, at the end, "What is dyno idling?"

Apps that have more than 1 web dyno are never idled out. Workers dynos are never idled out.

Basically, this happens on the free tier. If you start up a second dyno (i.e., pay $35/month), the dynos will not idle.

If it's the case where your client is doing a presentation, i.e., a scheduled look at the application during a meeting, the idling doesn't occur until after an hour of inactivity. If he doesn't feel like paying $35/month in this scenario, he can poke the application before the meeting to wake it up.

share|improve this answer

There are two options:

  1. Pay for it

    As soon as you heroku scale web= above 1 the app will never iddle out, as cjk and flurdy also mention in their answer. This is by far the best option if you have a single site that is paying its own bills. If you're maintaining many sites, the costs add up though.

  2. Periodically ping the service

    This option is the interesting one. For low trafic sites there is no free solution I could find. Pingdom (as mentioned by ceejayoz) is free for one site, so that would solve the problem once. If you need more sites, you can also use to keep your heroku dynos alive. This will also quickly run out of the free tier though and then you'll be paying

    If you are lucky enough to have a server running already, you can stick a curl to your site in the crontab. This solution scales best of course.

share|improve this answer

Have your Heroku-hosted site indexed by Google (and other major search engines).

A Heroku app I uploaded a few months ago for internal use, but which has to be accessible to clients, has somehow been found by Google and the (very small) public section of the site indexed. Nevertheless, a few months after first putting it up, Google is making about one request every 70 seconds, more than enough to keep the dyno active continuously.

share|improve this answer
That's strange, but it is a solution if you're that lucky :) – iwein Jan 11 '13 at 20:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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