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?

@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.
–
iweinNov 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.
–
ceejayozNov 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.
–
iweinNov 5 '12 at 5:51

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.

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: iweinfuld.posterous.com/…
–
iweinNov 2 '12 at 6:10

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.

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.

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.

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 Iron.io to keep your heroku dynos alive. This will also quickly run out of the free tier though and then you'll be paying Iron.io.

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.