Search code examples
ruby-on-railsherokupageload

Rails app Time to first byte very high using heroku


When loading my rails app in production (hosted on heroku) it takes up to 10 seconds to load. This only happens on the very first time the site is loaded. Any subsequent page views load normally. View at kurtiselliott.com


Solution

  • This is because Heroku will lazily spin up your dyno which essentially means that the first request will take ~10 seconds. If you leave your app idle for a little while Heroku will spin down your dyno.

    See article for full explanation

    https://devcenter.heroku.com/articles/dynos#dyno-sleeping