A single dyno that runs Unicorn can serve as many concurrent requests as it has Unicorn workers available. A dyno that runs four Unicorn workers can serve a maximum of four requests at a time. If our dyno receives more than four concurrent requests, it will add the extra requests to a queue and process them once a worker is available.
This can be problematic on Heroku due to how Heroku routes requests to dynos. Heroku's router sends requests randomly to any dyno that does not have a full backlog. Ideally, we'd like Heroku to route requests to the dyno that is most capable of serving the request quickly. The default setting for Unicorn's backlog is 1024 requests. This means that a Unicorn dyno can have a queue of 1,024 requests before Heroku will stop sending requests to it.
In this recipe, we will learn how to reduce our Unicorn backlog to keep requests from piling up on a single dyno and have Heroku reroute our requests to a dyno with available capacity...