29

I have an application hosted on AppHarbor that is visited a few times a day with a light load.

The performance experience is a SLOW first page load as the dormant worker process wakes up. Subsequent page loads are fast.

I want to reduce the amount of time for the initial load. Will buying additional instances solve this issue, or should I look towards a dedicated host

friism
  • 19,068
  • 5
  • 80
  • 116
nachonachoman
  • 802
  • 1
  • 13
  • 29

2 Answers2

25

You app pool will be spun down after 20 minutes of inactivity, this is standard IIS behaviour.

To avoid this, you can upgrade from Canoe to either the Catamaran or Yacht plans. Web apps on those plan don't idle (adding a custom hostname, SSL or running more than one dyno on the Canoe plan will still give you an idling app).

You can also circumvent the idling by using services like Pingdom and StillAlive to generate requests for your site. But upgrading from Canoe is fairer to AppHarbor.

friism
  • 19,068
  • 5
  • 80
  • 116
  • 2
    We now recommend upgrading to a paid plan (Catamaran or Yacht) where workers do not idle out due to inactivity. Apps can also be scaled vertically to further improve performance - there are more details in this blog post http://blog.appharbor.com/2013/03/13/introducing-vertical-scaling-make-your-workers-better-faster-and-stronger – runesoerensen May 01 '13 at 01:12
  • 2
    It looks like another free alternative monitoring/pinging service is [BinaryCanary](http://binarycanary.com). This could prove useful even for those not using AppHarbor. – Scott Jun 19 '13 at 20:47
  • You can also do host this yourself (on appharbor): http://www.jefclaes.be/2013/01/keeping-your-appharbor-application-pool.html – JefClaes Nov 18 '13 at 08:32
  • Also free add-on New Relic has can monitor the availability of your site keeping your website up until the next programmed pool recycle by AppHarbor. Additionally you will get reports and alerts which is an interesting plus – Ferran Salguero Aug 18 '15 at 19:02
  • @FerranSalguero New Relic only seems to only offer pinging to the url, the full page load monitor type (which is needed to keep the website up) is payed. Or am I missing something? – mdc Mar 13 '16 at 01:33
  • @mdc for my own experience with the url ping is enough, it makes the website keep running and not idling as the OP was asking, of course this does not avoid the daily (aprox.) pool recycle – Ferran Salguero Mar 15 '16 at 15:46
  • @FerranSalguero Thats strange. After some experimenting I find it to idle much less now (not every 20min at least) but once in a while it takes forever to load (30-80sec) despite pinging it with New Relic. – mdc Mar 15 '16 at 15:54
5

The way I do it, is have something like this running locally: https://github.com/haf/Requester

It just queries the web app every nth second and keeps it in memory. It's a hack, but it works and the problems go away when the app becomes more popular. ^^

Henrik
  • 9,714
  • 5
  • 53
  • 87