Bye bye apache … Hello nginx!
Posted in Site, performance on January 29th, 2009Tags: apache, performance, site.nginx
I thought it was a bit rude for this site to look so good but perform so poorly. So I decided to knock off one of the items on my list of accomplishments for ’09 – number #3 ‘Get this VPS running a lot faster’.
I was getting alerts about there being issues with high amount of swap being used and high IO usage (attributed to the amount of swap that was being used)
Here’s a look at what the box was running initially:
jared@kippage:~$ free -m total used free shared buffers cached Mem: 256 236 20 0 1 37 -/+ buffers/cache: 196 59 Swap: 511 274 237
Not good right? Look at how much swap is being used. Ridiculous. So I started to do a bit of investigation.
I killed all Apache processes and the amount of swap reduced by double. Interesting I thought. I took Apache out of the startup scripts and did a quick reboot. Interestingly, there was no swap being used.
I decided to google for information about Slicehost and performance issues with Apache.
This slice only has 256mb RAM. Not a whole lot, especially when Apache starts getting greedy.
I stumbled accross the following articles:
- http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup/
- http://forum.slicehost.com/comments.php?DiscussionID=945&page=1#Item_0
- http://articles.slicehost.com/nginx
All of these articles seemed to shed A LOT of information on the benifits of getting nginx (main page here) up and running.
After having nginx running for the last hour or so I have noticed a dramatic improvement in the speed of the site. At present this is what the memory situation looks like:
jared@kippage:~$ free -m total used free shared buffers cached Mem: 256 229 27 0 4 36 -/+ buffers/cache: 188 67 Swap: 511 0 511
So you can see by just installing nginx I have managed to get rid of my machine using swap all together.
I’ll keep an eye on the statistics for the site and see if the site continues to run at these speeds.
I have noticed however, a few 504 gateway timeout issues which I think I may have resolved. Will keep an eye out though.
If all goes to plan we’ll start seeing more performance out of nginx which means a better browsing experience for you guys!
On another note, make sure you check out slash slash dawt, there’s some great stuff coming out of that place!
If you use twitter be sure to add us! @jadz0r and @kippage. If you don’t use twitter, sign up! It’s great!
Jared