Why are my basic Heroku apps taking two seconds to load?

Lance Pollard picture Lance Pollard · Apr 9, 2010 · Viewed 51.9k times · Source

I created two very simple Heroku apps to test out the service, but it's often taking several seconds to load the page when I first visit them:

All I did was create a simple Sinatra app and deploy it. I haven't done anything to mess with or test the Heroku servers. What can I do to improve response time? It's very slow right now and I'm not sure where to start. The code for the projects are on github if that helps.

Answer

clyfe picture clyfe · Apr 9, 2010
  • If your application is unused for a while it gets unloaded (from the server memory).
  • On the first hit it gets loaded and stays loaded until some time passes without anyone accessing it.

This is done to save server resources. If no one uses your app why keep resources busy and not let someone who really needs use them ?
If your app has a lot of continous traffic it will never be unloaded.

There is an official note about this.