Ask HN: Which server for Rails is the most recommended?

8 points by garibm ↗ HN
I want your opinion on choosing which server to use for production rails project. And what to use for deployment. I am in between Passenger and Unicorn for server. Capistrano or Jenkins for deployment? What I need is speed and scalability. And flexibility regarding to on subdomain redirections. Seems like Unicorn has problems with it.

3 comments

[ 2.9 ms ] story [ 19.2 ms ] thread
If you're thinking between Passenger and Unicorn, the main determining factor between the two is that Unicorn is most efficient when you're serving a single application in production. Meanwhile Passenger is best if you have multiple apps running on the same server.

In terms of functionality (i.e., subdomain redirects) both are practically identical. The one functionality that's tougher is the ability to do streaming. In that case, you'll have to look at Puma, Rainbows!, or Thin.

And in terms of deployment, you'll use Capistrano. You can use Jenkins too if you're looking to setup continuous integration, but you'll need Capistrano regardless in order to deploy to production.

It depends on your needs and the needs of your application. These days, I almost never even consider Passenger because I find Unicorn and Puma easier to setup and scale. The benefit of Passenger being "deploy many apps on one machine" sounds like a good way to get yourself into a single point of failure situation for all of your applications.

I almost always start with Puma[0]. It uses threads, so your code, as well as any gems you are using, have to be threadsafe. Chances are you'll be ok. Puma shines for applications that do a lot of IO, which is most Rails applications. The type of performance you get out of Puma depends on the hardware underneath, but on a 1:1 comparison Puma tends to outperform Unicorn.

In the odd chance that your app is CPU bound a lot, go with Unicorn. It's fairly performant but due to it's single threaded nature you'll need to run more Unicorn workers and thus use more RAM.

As far as deployment, Capistrano is a lot better since version 3. If you're only deploying to one machine checkout Mina[1] or Recap[2]. Mina actually generates a shell script of your deployment tasks, which is pretty neat. Recap only works for Ubuntu.

0 - http://puma.io

1 - https://github.com/mina-deploy/mina

2 - https://github.com/tomafro/recap

I wonder why I was downvoted. Tough crowd.