For Ruby applications on Heroku, Unicorn should be our default choice when picking a web server. When Unicorn starts up, it forks our application's process. Each fork is known as a worker process. Each one of these processes are able to respond to web requests. The more processes we run, the more concurrency will be available on a single dyno.
As each worker is its own process, it has its own memory space, so we do not need to worry about our application's code being thread safe. This makes Unicorn a good choice for developers who are unsure whether their application can handle threading.
To begin, we will need to set up our existing Rails application to run Unicorn.
Note
If you'd like to skip this setup, you can use an example application available on GitHub at https://github.com/mscoutermarsh/unicorn-rails-heroku. This application is already set up to use Unicorn on Heroku.
Perform the following steps:
First, we'll need to add Unicorn to...