Running unicorn gracefully on Heroku

Jamie Wilkinson jamie at jamiedubs.com
Thu Mar 8 05:58:24 UTC 2012


On Mar 7, 2012, at 1:27 PM, Alex Sharp wrote:

> This guy seems to have figured it out: http://michaelvanrooijen.com/articles/2011/06/01-more-concurrency-on-a-single-heroku-dyno-with-the-new-celadon-cedar-stack/

Yeah this works great, I've used it for all my Heroku rails apps without issue for a while now. You just put unicorn in your bundle, make a Procfile like

	web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb

and a config/unicorn.rb like

	worker_processes 2
	timeout 5 # Heroku timeout is 5s

Related: like this post[1] I'm also interested in a smarter way to trap Heroku's SIGINT restarts into a unicorn USR2-styl restart, so we can actually take advantage of unicorn. At high concurrency Heroku's "kill world" restarts cause a lot of errors.

[1] <http://stackoverflow.com/questions/9605703/how-can-i-tell-unicorn-to-understand-herokus-signals>




More information about the mongrel-unicorn mailing list