Bob Cavezza's Blog

If you are new to Ruby on Rails and you recently launched your first application on Heroku, you may be puzzled by how slowly your website loads at times.  Heroku has a built in power up/power down mechanism that automatically powers down your application if no one visits your website over a 5-15 minute period of time.  The application will stay down until someone visits the app again.  When someone visits the application, it will load, but it will typically take 20-30 seconds to power back up.  Not many users will stick around for this, but there is a trick most developers use to keep their Heroku app up all the time.  The trick is a side effect of using website monitoring tools

Website Monitoring Tools

There are tools like Uptime Robot and Pingdom that you can setup to make sure your website is available 24/7.  You should set these tools up to ping your website every five minutes.  The reason these websites exist is to monitor your website for outages.  Either you or your development team could accidentally bring your website down.  These tools check for website downtime and email you updates whenever the state of your website changes.  The awesome side effect of these services is that if the service is pinging your website every five minutes, Heroku doesn’t realize it is not a real human, so it never powers down your website.  Victory!

§316 · October 2, 2014 · Software Development · · [Print]

1 Comment to “Why Your First Heroku Rails App Loads So Slow”

  1. smefju says:

    The problem is that Heroku is still a bit slow even when you pay for your dynos. This is probably because of AWS infrastructure (“double virtualization”) and poor route on the front-end. I would recommend to take a look at Shelly Cloud PaaS hosting (https://shellycloud.com) which is a good alternative for Heroku ;). https://shellycloud.com/blog/2013/05/is-shelly-cloud-faster-than-heroku

Leave a Reply