News for hackers. Stuff that matters.
Re:Heroku's Ugly Secret: The story of how the cloud-king tur... by scottshea on Wednesday February 13, 2013 @10:31PM (#5217520)
To amplify, I do a ton of queue adjustment work with Unicorn at the backlog level. It is so frequent that we set up Unicorn startup to read from an ENV variable on Heroku that we set as needed.

With two Unicorn workers we found that 25 was the best backlog threshold to accept (it refuses additional requests). When we were able to go to 5 Unicorn workers on Heroku we had to start to adjust that.

Re:Heroku's Ugly Secret: The story of how the cloud-king tur... by tibbon on Wednesday February 13, 2013 @10:43PM (#5217559)
You don't happen to have any documentation for how to do that do you? Very curious. Never seen anything about setting up Unicorn like this prior (I'm just using 3 or 4 Unicorns/dyno currently)
Re:Heroku's Ugly Secret: The story of how the cloud-king tur... by jwrubel on Thursday February 14, 2013 @11:21AM (#5220124)
Here's a gist of our unicorn.rb config (https://gist.github.com/apangeajwrubel/4953849) Using env variables lets us adjust parameters without a code push (still requires a restart). We saw dramatic reduction in 'long tail' requests when we dropped the backlog to 25. We're experimenting now (thanks to @scottshea) with even lower values. At some point the routing mesh will give up retrying and throw an H21 (https://devcenter.heroku.com/articles/error-codes#h21-backen...). One data point that would be useful from heroku is how many retries we get.
Re:Heroku's Ugly Secret: The story of how the cloud-king tur... by pointful on Thursday February 14, 2013 @11:32AM (#5220187)
To expand on this:

You have to remove the port declaration from the line for Unicorn in your Procfile, and then add a line like this to your unicorn.rb file to define the listener port along with adjusting the backlog size:

listen ENV['PORT'], :backlog => Integer(ENV['UNICORN_BACKLOG'] || 100)

Re:Heroku's Ugly Secret: The story of how the cloud-king tur... by scottshea on Thursday February 14, 2013 @11:04AM (#5220041)
We did this in unicorn.rb `:backlog => Integer(ENV['UNICORN_BACKLOG'] || 200)` and then set the UNICORN_BACKLOG variable by the Heroku command line `heroku config:set UNICORN_BACKLOG=25 -a <app_name>`. We have been as high as 1024 and as low as 10. We settled in at 25 for us.