Over the past few weeks, I’ve been learning quite a bit about nginx. Most of AuthorityLabs has been running on nginx, with the most notable exception being the part of our site running on WordPress. I’ve been a long time fan of having a LAMP stack and when we migrated the site to AWS earlier this year, that’s what I wanted set up.
While Apache is a great server, I’ve come to realize that it can be bloated and many times it ends up costing time and money to work around the bloat and quirks. As Chris Lea put it, “Apache is like Microsoft Word; it has a million options but you only need six. Nginx does those six things, and it does five of them 50 times faster than Apache.” A lot of people don’t NEED Microsoft Word, just like they don’t NEED Apache.
As of October 2011, nginx is serving up 11.28% of sites. Not a staggering figure by any means, but for something that had its first stable release a few months ago, that’s pretty good. They also recently received $3 million in funding. It should be interesting to see how that works out. Considering their growth, funding, and the fact that nginx is powering some high profile sites such as Facebook, Zappos, Groupon, and WordPress.com, it shouldn’t be long before a lot of people take notice and start making the move.
Why should you care?
Nginx is fast. Performance testing nginx vs. Apache with AuthorityLabs showed that for our simple WordPress installation, page loads and response times were cut in half. I’ll admit that I’m not the best at tuning Apache and we may have been able to speed it up a bit, but I spent almost no time customizing the configuration of nginx and it just worked.
Nginx is flexible. With Apache, if you have something like PHP installed, every site running on that install of Apache would be running PHP. There are cases where that is definitely not ideal. Nginx allows the ability to specify what languages and options are available on a site by site basis. That means you could run WordPress and a Rails app on different sites running off the same nginx install and not end up with conflicts or added overhead.
Nginx is growing. Apache has been around a long time and it seems like it has become pretty stale. There’s not a lot of new innovation and it’s rare to see cool new tricks. With nginx, there are cool new ideas coming out all the time. Whether it’s microcaching, json hacks, and a cool tool for porting Apache .htaccess rules to nginx.
Do you really need to make the switch?
This really depends on your needs and knowledge. Many people are going to be fine sticking with their shared hosting, vps, or managed dedicated servers where options may be limited and they can only run Apache. If you’re concerned about performance and speed, nginx is definitely worth considering. There is a learning curve, but it’s not bad. There are plenty of tutorials out there to help get you going. For me, if I could move everything I have to nginx right now, I would. The main hold up on that is time and the ability to get a lot of vastly different IP addresses to get rid of footprints 😉
Ready to make the switch to nginx?
We’re working on some pretty cool tools and information that will get you going with nginx at a very reasonable price. Keep an eye out on our blog over the next few weeks and we will be spewing all kinds of sweet information about getting set up, configuring, and running nginx.