Ask HN: Which server for Rails is the most recommended?
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 ] threadIn 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.
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