Our main constraint when running multiple Unicorn workers is the memory available on the dyno. A typical application will use somewhere between 50 and 200 MB of memory per process. We want to configure our application to use between 50 to 70 percent of the available memory on a dyno. This gives our processes room to grow while still using most of the resources we are paying for.
In this recipe, we will be learning how to determine how much memory our application uses per Unicorn process. We will then be tweaking our configuration to maximize concurrency within a single dyno.