Heroku Boot Timeout (Error R10)

Heroku's boot timeout bit me too. I read several blog posts about how to get around it and ended up automating some of the solutions into a gem.

To reduce the startup time on deploy, you can trim the gems loaded at boot time (this doesn't mean you have to trim them from the app, just boot time).

gem_bench evaluates which gems are likely to not be needed at boot time.

I have an app with about 250 gems and was able to add :require => false to about 60 of them, with dramatic effects.

https://github.com/acquaintable/gem_bench

Disclaimer: I am the author of this open source ruby gem. I wrote the gem to aid myself in solving this exact problem: the 60 second timeout on Heroku.


The solution was that I had forgotten to include the -p $PORT in my Procfile line.

in Procfile change:

web: bundle exec thin start

to

web: bundle exec thin start -p $PORT

That fixed it for me.


If your app does take longer than 60 seconds for "good" reasons, you can work around the 60s boot time limit with https://github.com/dblock/heroku-forward.

Tags:

Heroku