Posts Tagged ‘php’

Setting up Nginx with Rails

Posted by rich on May 22nd, 2008 categorised as How-to | 2 Comments »

So the other day I decided to switch from using Apache to Nginx not because apache isn’t any good, far from it. Nginx just uses much less ram and when you’re on a fairly small slice, using up more ram just isn’t good. I was going to benchmark speed and things between apache and nginx but I forgot to take some readings before stopping the apache service and installing nginx so we’ll skip over that idea like the thought never came into my head.

I’ll mention a few things I like about nginx first:

  1. It’s Russian -Being Russian it makes me feel like a communist, which is fun. It also reminds me of being build to take all things thrown at it.
  2. It uses a lot less memory - As I said before, not really done much benchmarks so these were some quick figures from ‘top’ but I had apache running with about 5 instances each using 2-3% of ram even at 2% each that’s still 10% of ram being used just for apache… with nginx I appear to have 2 instances running both using 0.2% of ram, so 0.4% in total - which is a nice difference.
  3. Faster page serving - Now this is meant to be a server fast at serving static content so its not just be me but I find the site much quicker compared to when it used to be on apache (all the sites in fact). I’m not to sure if I just think it’s quicker, the slice has more ram free so never going into swap or…. it is just a lot quicker at serving pages.

Read the rest of this entry »