Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Keeping your Heroku app awake
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  20 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nick  
View profile  
 More options Feb 14 2012, 12:34 pm
From: Nick <ntaberna...@gmail.com>
Date: Tue, 14 Feb 2012 09:34:21 -0800 (PST)
Local: Tues, Feb 14 2012 12:34 pm
Subject: Keeping your Heroku app awake
I've written a short blog post on how to keep your heroku dyno from
'timing out' which can lead to a slow loading site for those with a
low amount of traffic.

For those interested:

http://beouk.blogspot.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John McCaffrey  
View profile  
 More options Feb 16 2012, 3:34 pm
From: John McCaffrey <john.mccaff...@gmail.com>
Date: Thu, 16 Feb 2012 14:34:09 -0600
Local: Thurs, Feb 16 2012 3:34 pm
Subject: Re: Keeping your Heroku app awake

Once you pay for a dyno, its up all the time, so this strategy is only
necessary when you are not yet paying to host your site on heroku.

So I think it makes sense to take the idea of "ping the server every X
min", and add a bit more to the logic of asserting that the response is
correct and timely. Implementing even a basic strategy for monitoring your
application's uptime, performance, and consistent functionality is an
important component in how you manage your site, and there are a variety of
tools out there that can help.

New relic can ping your app and alert you when it is not responding and
passing your assertion test. (specific words on a page)

You can have a simple ping and report from http://www.internetvista.com

BrowserMob.com and others can do multistep flows like logging in and
navigating to a page.

StillAlive.com and the heroku add on is great for defining a full
cucumber-like test suite to ensure that not only is your site up, but it is
still functional.

But I hope that people use some restraint when deciding which of their apps
they want to 'artificially keep awake', and find a nice balance that uses
resources wisely.

Using the free plan on cloudflare.com CDN might be useful, particularly if
your main pages and most of the assets can be cached. (the page will load
quickly in the browser, from the cdn, then fire an uncacheable request to
wake up the server, without the user feeling like its slow).

Actually using cloudflare is a win-win even after you're off the free
heroku plan, because it allows you to handle more concurrent users and load
things faster.

--
Thanks,
-John

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Dixon  
View profile  
 More options Feb 16 2012, 3:38 pm
From: Jason Dixon <ja...@dixongroup.net>
Date: Thu, 16 Feb 2012 15:38:43 -0500
Local: Thurs, Feb 16 2012 3:38 pm
Subject: Re: Keeping your Heroku app awake
+1000

--
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter van Hardenberg  
View profile  
 More options Feb 16 2012, 3:39 pm
From: Peter van Hardenberg <p...@heroku.com>
Date: Thu, 16 Feb 2012 12:39:54 -0800
Local: Thurs, Feb 16 2012 3:39 pm
Subject: Re: Keeping your Heroku app awake
As a database guy at Heroku, I'm not one to speak authoritatively on
this, so please take this as the personal thoughts of someone and not
an official statement.

We idle apps in order to avoid having to charge for them. The more
people who prevent this behaviour, the more expensive our "free" apps
become to run, and the more likely we are to have to change our
policies about what we can offer in a free app.

While I admire the ingenuity in this post, I would suggest that you
reduce the amount of time your application takes to boot, or simply
accept that a few seconds of lag on the first request after a period
of idleness is a reasonable trade-off for free web hosting.

Peter


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick  
View profile  
 More options Feb 17 2012, 7:44 am
From: Nick <ntaberna...@gmail.com>
Date: Fri, 17 Feb 2012 04:44:03 -0800 (PST)
Local: Fri, Feb 17 2012 7:44 am
Subject: Re: Keeping your Heroku app awake
Peter,

I take your points well. I don't mean to try and 'do one over' on
Heroku. I appreciate the service you offer very much. My thinking
behind it was that you would never exceed the 450 hours of dyno time
allocated to each app so there wouldn't be a problem and if you did
you would be charged anyway.

Is there a paid for solution from Heroku to achieve the same result?
The cost jump between 1 free dyno and paying for a dyno is quite large
for small applications. So perhaps you could offer a $10 package which
essentialy works the same way? If i'm honest I don't feel I pay Heroku
enough but I have too many small apps (10 or so) to pay for each one
to have a dedicated dyno.

?
On Feb 16, 8:39 pm, Peter van Hardenberg <p...@heroku.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter van Hardenberg  
View profile  
 More options Feb 17 2012, 11:58 am
From: Peter van Hardenberg <p...@heroku.com>
Date: Fri, 17 Feb 2012 08:58:39 -0800
Local: Fri, Feb 17 2012 11:58 am
Subject: Re: Keeping your Heroku app awake

On Fri, Feb 17, 2012 at 4:44 AM, Nick <ntaberna...@gmail.com> wrote:
> Is there a paid for solution from Heroku to achieve the same result?
> The cost jump between 1 free dyno and paying for a dyno is quite large
> for small applications. So perhaps you could offer a $10 package which
> essentialy works the same way? If i'm honest I don't feel I pay Heroku
> enough but I have too many small apps (10 or so) to pay for each one
> to have a dedicated dyno.

Fair question. I don't know that there is a good solution today, but I
can definitely imagine how one might feel as though a number of
smaller, low-traffic apps which you'd be willing to pay something for
might not add up to making sense to pay $350/mo to run.

In the shortest term, addressing the boot time of your app is the
fastest way to make initial route times faster, but that's a crummy
solution overall. Wish I had better advice or ideas. In the mean time,
if you do set up something like this, just keep that in mind. It's not
a big deal, but it does put gradual pressure on our systems.

I'll take your question to our people who are thinking about these
problems. We'll have to find a solution eventually.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Huckstep  
View profile  
 More options Feb 17 2012, 1:27 pm
From: Daniel Huckstep <darkhel...@darkhelmetlive.com>
Date: Fri, 17 Feb 2012 10:27:20 -0800 (PST)
Local: Fri, Feb 17 2012 1:27 pm
Subject: Re: Keeping your Heroku app awake

I thought the Cedar dynos didn't turn off when idle. Can't remember where I
got that idea from though, so I'm probably entirely wrong.

But there's also http://devcenter.heroku.com/articles/dyno-idling which
suggest that you could scale your web dynos to zero (on Cedar) and use a
different process name to run the webserver (I'm assuming this would work,
haven't tried it). This is because the other processes (non web) could be
used for other fun things, like running redis (there was an example in a
presentation that showed some TCP routing) which you don't want to turn off.

Also, in your post you say 450 hours, which is incorrect. It's 750.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John McCaffrey  
View profile  
 More options Feb 17 2012, 1:39 pm
From: John McCaffrey <john.mccaff...@gmail.com>
Date: Fri, 17 Feb 2012 12:39:35 -0600
Local: Fri, Feb 17 2012 1:39 pm
Subject: Re: Keeping your Heroku app awake

I think this is a good discussion to have, in terms of appropriate use of
'free resources' to keep the plan sustainable, and "reasonable pricing for
the 'little guy'" with tons of small apps that don't get daily usage.

Those topics are important, but not something that will be resolved any
time soon, the more tractable computing problem is how to best optimize a
site on the free plan, so as to minimize the impact of spinning up a dyno.

A few strategies:
1. use browser and http caching for as much as you can
2. use a cdn like cloudflare.com or others
3. reduce dependencies for your app?
4. figure out what is slow, and how to improve it....

I'm not really sure what is happening in the spin up of a dyno, and what I
could do to make it better. I just hit an idle app of mine and looked in
the logs to see what it was doing.
2012-02-17T18:22:35+00:00 heroku[web.1]: Unidling
2012-02-17T18:22:35+00:00 heroku[web.1]: State changed from down to created
2012-02-17T18:22:35+00:00 heroku[web.1]: State changed from created to
starting
2012-02-17T18:22:39+00:00 heroku[web.1]: Starting process with command
`bundle exec unicorn -p 56060 -c ./config/unicorn.rb`
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.412560 #1]
 INFO -- : listening on addr=0.0.0.0:56060 fd=3
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.413000 #1]
 INFO -- : worker=0 spawning...
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.416644 #1]
 INFO -- : worker=1 spawning...
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.417177 #9]
 INFO -- : worker=0 spawned pid=9
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.417390 #9]
 INFO -- : Refreshing Gem list
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.418434 #1]
 INFO -- : worker=2 spawning...
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.420059 #1]
 INFO -- : worker=3 spawning...
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.420874 #12]
 INFO -- : worker=1 spawned pid=12
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.421081 #12]
 INFO -- : Refreshing Gem list
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.425084 #1]
 INFO -- : master process ready
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.426771 #14]
 INFO -- : worker=2 spawned pid=14
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.426987 #14]
 INFO -- : Refreshing Gem list
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.446178 #18]
 INFO -- : worker=3 spawned pid=18
2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.446496 #18]
 INFO -- : Refreshing Gem list
2012-02-17T18:22:42+00:00 heroku[web.1]: State changed from starting to up
2012-02-17T18:22:48+00:00 app[web.1]: Cannot find or read
/app/config/newrelic.yml
2012-02-17T18:22:55+00:00 app[web.1]: Cannot find or read
/app/config/newrelic.yml
2012-02-17T18:22:56+00:00 app[web.1]: Cannot find or read
/app/config/newrelic.yml
2012-02-17T18:22:56+00:00 app[web.1]: worker=1 ready
2012-02-17T18:22:56+00:00 app[web.1]:
2012-02-17T18:22:56+00:00 app[web.1]:
2012-02-17T18:22:56+00:00 app[web.1]: Started GET "/" for 67.162.61.119 at
2012-02-17 18:22:56 +0000
2012-02-17T18:22:57+00:00 app[web.1]: Cannot find or read
/app/config/newrelic.yml

So if I'm reading this right, a request came in at 18:22:35, and woke up
the dyno, and that request passed through to the app at 18:22:56, meaning
there was about a 21 second delay.

There seems to be some time in between each
" Cannot find or read /app/config/newrelic.yml"
I wonder if putting that config in there would make the spin up faster?

I'm also spinning up 4 unicorn workers, would it be faster to start with
only 1 or 2, and then add the others later (is that something that
could/should be done programmatically?)

I'm curious what other people are seeing for dyno spin up times, and any
strategies for making things go faster. (Wonder if I'm including any gems
that are not needed in prod, and if that has an impact)

Run heroku logs for one of your idled dynos, then hit the url and see how
long it takes, is there a lot of variation? (bamboo vs cedar, thin vs.
unicorn, rails vs. sinatra, etc)

On Fri, Feb 17, 2012 at 12:27 PM, Daniel Huckstep <

--
Thanks,
-John

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kevin Goslar  
View profile  
 More options Feb 17 2012, 1:47 pm
From: Kevin Goslar <kevin.gos...@gmail.com>
Date: Fri, 17 Feb 2012 10:47:39 -0800
Local: Fri, Feb 17 2012 1:47 pm
Subject: Re: Keeping your Heroku app awake

I would like to +1 the idea to come up with a way to get an always responsive app on Heroku for a reasonable price.

The current free plan makes the site so unresponsive on the first request that it's really only good for testing and toy sites, the next level for $36/month and 2 permanent dynos is a big step away for many people. I think there is a sweet spot in between there, in which Heroku could reach an monetize a large market segment.

Just my 2 cents.  :)

Kevin

On Feb 17, 2012, at 10:27 AM, Daniel Huckstep <darkhel...@darkhelmetlive.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Neil Middleton  
View profile  
 More options Feb 17 2012, 7:48 am
From: Neil Middleton <neil.middle...@gmail.com>
Date: Fri, 17 Feb 2012 12:48:46 +0000
Local: Fri, Feb 17 2012 7:48 am
Subject: Re: Keeping your Heroku app awake

I'm confused here.

The 'starter' package is only ~$35/mo which isn't exactly monumentally expensive.  Are you suggesting something between that and free?
What you're suggesting sounds like your charged by the CPU cycle rather than the hours?

To be brutally honest, I host loads of apps on 1 web dyno and just make sure that the spin up time is short enough that it's not a problem.  If I ever need to run more than 1 web dyno it's generally because the traffic levels require it, in which case $35 becomes less of a problem.

Personally, I think that having a single dyno, which can still serve hundreds of thousands of requests a day /for free/ is a pretty good deal.  I'm happy to pay $35 to double it.

Neil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kevin Goslar  
View profile  
 More options Feb 20 2012, 4:20 pm
From: Kevin Goslar <kevin.gos...@gmail.com>
Date: Mon, 20 Feb 2012 13:20:47 -0800
Local: Mon, Feb 20 2012 4:20 pm
Subject: Re: Keeping your Heroku app awake

I think having a single permanent (i.e. always instantly responding) dyno for $10-20/month would make sense for a lot of people. It definitely provides for a much better user experience than the current free plan, especially for low traffic scenarios.

It could work like this: free plan as before, for testing etc. Once in a low-traffic production environment, upgrade the free dyno to a permanent dyno for $10-20/month. Then later, buy a second dyno for $35/month.

Kevin

On Feb 17, 2012, at 4:48 AM, Neil Middleton <neil.middle...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed Jones  
View profile  
 More options Feb 20 2012, 4:56 pm
From: Ed Jones <ed.jo...@gmail.com>
Date: Mon, 20 Feb 2012 13:56:32 -0800 (PST)
Local: Mon, Feb 20 2012 4:56 pm
Subject: Re: Keeping your Heroku app awake
Neil said:

> I host loads of apps on 1 web dyno and just make sure that the spin up time is short enough that it's not a problem.

Neil and others, thanks.

I just launched a new (beta) app, and the response time is just
horrible.

Could you pass a few tips on how to "make sure that the spin up time
is short enough"?
Thanks!!!

ed

On Feb 17, 7:48 am, Neil Middleton <neil.middle...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Neil Middleton  
View profile  
 More options Feb 20 2012, 5:15 pm
From: Neil Middleton <neil.middle...@gmail.com>
Date: Mon, 20 Feb 2012 22:15:08 +0000
Local: Mon, Feb 20 2012 5:15 pm
Subject: Re: Keeping your Heroku app awake

To be brutally honest, there is no hard and fast rule, but I have found the following:

- Rails is really fast at slowing down, so ensure that your dependencies and initialisers are at an absolute minimum.

- Keep things small and lightweight, break your application up into lots of smaller applications. Sinatra, for instance, spins up almost instantly on Heroku and can take you a fair distance in terms of simple functionality

- Generally speaking, the newer the Rails version, the quicker the spinup time, especially if you're not using ActiveRecord

- If you're feeling beta-y, try running on Ruby 1.9.3, this makes a massive difference to Rails.

Other than this, I'm not really aware of any silver bullet, but I do know that lots of smaller more focused applications spin up better than one monolithic Rails app, which is why Unix is so good I guess.

-Neil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sejensen  
View profile  
 More options Feb 21 2012, 3:38 am
From: Sejensen <sejen...@gmail.com>
Date: Tue, 21 Feb 2012 00:38:14 -0800 (PST)
Local: Tues, Feb 21 2012 3:38 am
Subject: Re: Keeping your Heroku app awake
Hi Neil and others

These recommandations for Rails apps looks very good,

But in my case i use Scala and the netty server and spin-up time is
not good at all. And I am not sure it can be tuned so much as the
sinatra case when the platform is java.

Do anyone have any suggestions for my combo?

Kind regards
Steffen

On Feb 20, 11:15 pm, Neil Middleton <neil.middle...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick  
View profile  
 More options Feb 22 2012, 7:17 am
From: Nick <ntaberna...@gmail.com>
Date: Wed, 22 Feb 2012 04:17:12 -0800 (PST)
Local: Wed, Feb 22 2012 7:17 am
Subject: Re: Keeping your Heroku app awake
An option for a single site is http://www.pingdom.com/

They can 'ping' your site every hour thereby keeping it awake. It's
free for one site.

On Feb 21, 8:38 am, Sejensen <sejen...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kevin Goslar  
View profile  
 More options Feb 22 2012, 1:04 pm
From: Kevin Goslar <kevin.gos...@gmail.com>
Date: Wed, 22 Feb 2012 10:04:26 -0800
Local: Wed, Feb 22 2012 1:04 pm
Subject: Re: Keeping your Heroku app awake

With that, you keep Heroku unnecessarily busy by having them start a dyno
24 times every day, and your app still sleeps 55 min per hour.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Abner  
View profile  
 More options Feb 22 2012, 1:09 pm
From: Mike Abner <mike.ab...@gmail.com>
Date: Wed, 22 Feb 2012 10:09:48 -0800
Local: Wed, Feb 22 2012 1:09 pm
Subject: Re: Keeping your Heroku app awake

Did heroku turn down the time your app stays "awake" without any requests?  In the past it was in the 20 to 25 minute range, IIRC.

Mike


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
vzmind  
View profile  
 More options Mar 19 2012, 10:05 am
From: vzmind <vincent.speh...@gmail.com>
Date: Mon, 19 Mar 2012 07:05:56 -0700 (PDT)
Local: Mon, Mar 19 2012 10:05 am
Subject: Re: Keeping your Heroku app awake

Last update on that page say 1h:
http://devcenter.heroku.com/articles/dyno-idling

----Vz

Le mercredi 22 février 2012 18:09:48 UTC, Mike a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dB.  
View profile  
 More options Apr 28 2012, 11:57 am
From: "dB." <dbl...@dblock.org>
Date: Sat, 28 Apr 2012 08:57:03 -0700 (PDT)
Local: Sat, Apr 28 2012 11:57 am
Subject: Re: Keeping your Heroku app awake

I would answer your question by yes: something between free and 36$ for
less resources.

There're plenty of hosting options for 5-10$/month. In another market
(.NET), compare  http://www.winhost.com/ with 5$/mo dynamic up that's up
all the time. I have an old blog running there for 10$/mo, great. I would
love to rewrite it in Ruby and push it to Heroku, but price is certainly
not competitive for something small.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patrick Holloway  
View profile  
 More options Feb 4, 7:23 am
From: Patrick Holloway <patrickjhollo...@gmail.com>
Date: Mon, 4 Feb 2013 04:23:54 -0800 (PST)
Local: Mon, Feb 4 2013 7:23 am
Subject: Re: Keeping your Heroku app awake

+1 for intermediately priced "always available option.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »