Monthly Archives: May 2014

Why use Phusion Passenger for your Rails server

Phusion Passenger is one of three big players in the rails server game. The other two players are Unicorn and Puma. No matter which one you choose if you can configure it correctly and get through the setup process all of them work. All three of them are considered viable and able to handle the job. In my opinion though I feel that Passenger is the best out of the three.


The first reason why I really like Passenger is because they have really great documentation. If you are unable to resolve your issue after reading through their documentation you didn’t look close enough. For example this is Passengers documentation for their nginx module. Yeah it has a ton of configuration options that you can just stick into your nginx configuration file and go. Also if you are wondering why something is not working you will be able to find the answer easily either by going through the documentation yourself or going to Google. If you Google for an issue using Unicorn you will probably end up finding it but it could take you a while. When I consider choosing a technology to use support is the first place I look at like am I able to get support and is the tool so easy to use that I most likely won’t need that support. If the answer is yes to both of them to me that is a good place to start. If the answer is yes to documentation but not to suppose I think that is an okay starting point. Sometimes you will not be able to find both.


This one is a little controversial as the saying goes just because it’s popular doesn’t mean it’s great. That saying does hold true in some cases but when it comes to technology it usually doesn’t mean that it usually means a good sign. I have noticed that people in technology usually don’t stick with something too long if it’s not satisfying their needs. Passenger has great support including the rails core team. It also has support from some major companies including Basecamp, The New York Times, AirBnb, and Apple to name a few of them. If you would like to see a bigger list check out builtwith. Now the argument could be made that all of these companies have no clue what they are doing using Passenger but they all have very high levels of traffic and are well known as reputable companies. There is a reason why and passenger is a tool that helps them get there.

 Ease of Use

To be totally honest I only have experience in running Passenger and Unicorn. I have never had the experience setting up Puma so I will only be comparing Unicorn and passenger here. Although I have looked at Puma’s documentation and it doesn’t look so bad. Unicorn seems to be pretty easy to install on a single instance rails server. You can get your rails application up and running in a short amount of time. There are a lot of Unicorn scripts out there to get you started and up and running. The problem with Unicorn is when you have to do anything outside of running one application on the server. Dealing with multiple environments on one machine is possible (I think) but it seems like it wasn’t made for that. It also feels like Unicorn isn’t fully polished yet. Small things kept coming up like shutting down a Unicorn process without using the kill command. Like that example it just feels like commands that are suppose to work don’t. Now to be honest I am no server administrator so the problem may be obvious to someone else. So if you are a experience Unicorn professional these arguments could easily be debunked. The problem is most rails developers are not and therefore that argument really doesn’t matter. A lot of companies are rolling with developers being the server administrators also so the easier the tool is the better.

Install passenger is also a very simple process. The reason why it’s so simple is it ships with an installer that installs both passenger and nginx. You also install passenger and apache if that is your goal. In my case it was nginx. How cool is it that you get both nginx and passenger with one install. If you already installed nginx it’s recommended that you remove it and then run the passenger install. Also once it’s installed and started passenger handles everything else. This holds true even when you have multiple environments running on the same server. You don’t have to do any extra configuration to set this up either. You basically create another nginx file point it to the directory and go. Of course if you are adding another application on you will have to restart nginx but not passenger. Also passenger comes with a couple of pretty cool tools to monitor memory and performance. You simply type in the following command to get the memory usage.

rvmsudo passenger-memory-stats

Yes it’s that easy to monitor your rails processes. Unicorn you have to manually so a ps -ef | grep ‘unicorn’ to see the process. I suppose there are some tools like this for Unicorn but they don’t see as obvious to use. This tool is built into passenger so you can run it from anywhere you have an application running.

At the end of the day you have to use a tool that works best for your situation. Is passenger that tool probably but if you are an experience server administrator tools like Unicorn may be better. We all have our reason for choosing our toolset but you should have justification for those reason. At the end do whatever makes your life easier. In my case Passenger made my life easier as a non server administrator.

Here are some resources I used to determine the content in this post


Feedly Blog Manager

I didn’t start getting into blogs until about a year ago. So I missed the whole Google Reader era.  I always thought blogs were useless for some reason. I still feel that way about certain kind of blogs but technology blogs are very useful in my opinion. It’s a good way to pick up on what others are doing. So when I started getting into blogs I noticed that I was having to bookmark a lot of pages. Not only that but I also was having to visit these blogs to check if anything was updated. I was talking with a co-worker and he said he use to use Google reader but Google shut it down. He said he recently started to use Digg Reader. I looked at Digg and also Feedly and decided that I would go with Feedly. Nothing against Digg I just thought Feedly had a bigger user based and there had to be some reason behind that.

After using it for over a couple of months now I would have to say I am glad with my decision. Not only is it a great blog manager but you also get a lot of neat features for free. The main feature of course as it shows you only posts you have not read yet. This is nice so you know I have ten new blog posts to read. Then you don’t have to filter them out yourself Feedly does that for you. Also you can read the post inside the application so you don’t have to bounce from site to site. This can be nice but you do miss out on certain content like comments. If you are not into those then this might be the way to go. Another feature of the free version is it updates the blogs every four hours. For me this is fine I don’t check posts every day even sometimes I get to it once a week.

Another thing I like about Feedly is there Android application. It seems really well made and I am able to read posts while on the go. The posts just like the website open up inside the application so I don’t have to bounce around. Also you can go to the website just like you go on the site version.

Feedly also offers a pro version which you can upgrade for only 45 dollars a year. That is a decent price and you get a lot more features. So if you are really into blogs you can do things like send them to your Evernote account or get your blog posts 30 minutes sooner than the free version. In my opinion the free version is more than what I need but others may like the additional features.

So if you are looking for a blog manager I suggest you at least check out Feedly. It’s free, easy to use and works great.

Setting up multiple SSH profiles with Github


I recently had to setup multiple SSH profiles for Github. The reason why I had this requirement as my work required me to have a Github account outside of my personal account. The machine I am using is used for both work and personal development. I needed both SSH keys to work. I had never ran into this before as I never had two Github accounts. Since you are not able to use the same ssh key between multiple accounts in Github I had to come up with a way for both to work together. This makes sense for security purposes that the key should only be identified with one account. The process to set this up was pretty simple overall but that is after you understand what you need to do. Understanding exactly what is needed can be tricky at least from the documentation I found online.

The first thing you need to do is create a SSH key pair for both your personal account and work account. They should be using different email addresses.

$ ssh-keygen -t rsa -C "" # follow prompts use defaults if you want

$ ssh-keygen -t rsa -C "" # specify new name for key

After that is done you should have a couple of keys. For example you could have id_rsa and id_rsa_work or whatever you called them. Add the proper SSH keys to your Github accounts following Generating SSH Keys – Github. The documentation there is really well done so no further explanation is needed.

So now you should be able to use each SSH account by adding it. Everything will work at this point but you will have to keep adding the ssh-add when you switch between accounts. If you don’t switch often this may be fine but it’s a really pain if you switch often. Also you tend to forget overtime why it’s broken all the sudden.

ssh-add ~/.ssh/id_rsa

The next step is you need to create an SSH config to handle the multiple accounts.

sudo vim ~/.ssh/config # add in the hosts

# Inside the file add the following

    User git
    IdentityFile ~/.ssh/id_rsa
    User git
    IdentityFile ~/.ssh/id_rsa_work

Save and close it out and that part should be all set. The next part is the most critical. If you have an existing repo go and modify your SSH string to add in the -work or -personal. This is whatever you named your host. Here is an example for my personal project.[host-name]:[repo-name]/[repo-name]

If you are adding a new clone or new remote continue to use the same host name you set in your SSH profile. After you run the process it all makes sense it looks at the ssh config to determine which key to use.