Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku Boot Timeout (Error R10)

Tags:

heroku

Every time I launch my app it cannot get past the 60 second point without:

2012-05-06T22:41:11+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-05-06T22:41:11+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2012-05-06T22:41:11+00:00 heroku[web.1]: Process exited with status 137
2012-05-06T22:41:12+00:00 heroku[web.1]: State changed from starting to crashed

Here is my Procfile:

web: bundle exec thin start -p $PORT

Any responses will be thoroughly appreciated.

like image 401
camelCase Avatar asked May 06 '12 22:05

camelCase


3 Answers

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.

like image 106
dB. Avatar answered Sep 22 '22 18:09

dB.


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.

like image 37
saintsjd Avatar answered Sep 18 '22 18:09

saintsjd


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.

like image 44
Peter H. Boling Avatar answered Sep 22 '22 18:09

Peter H. Boling