LAMP vs LEMP seems to be a fairly one-sided debate these days. Apache (the “A” in LAMP) seems to be written off in almost every blog and forum post on the subject in favor Nginx (pronounced “engine X”, the “E” in LEMP). While Apache does seem to have some support in specific use cases, as a backend server with Nginx serving as a proxy, for example, the general sentiment seems to be that most agree with Chris Lea’s quote that “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.” This sentiment of nginx’s superiority being a forgone conclusion begs the question: is it time to dump Apache?
What does the market say?
Looking at the statistics from Netcraft’s January 2017 web server survey, it would be unfair to suggest Apache isn’t a viable solution in today’s market. According to the data, over 45 % of active websites use Apache.
While that is a significant drop from its peak of 70% in 2005, and it is true that Apache saw its decline in market share begin around the same time Nginx's began ramping up, people vote with their feet and their feet. It’s hard to deny the viability of a technology that is good enough for almost half the market and sees more than doubles the market share of its closest alternative.
How great is the difference in performance?
Nginx has become known for speed and scalability. Given that, according to Nginx.com, Nginx was designed to address the C10K problem, this makes sense. It’s not hard to find benchmarks that demonstrate just how powerful yet memory efficient Nginx is relative to Apache.
However, benchmarks don’t always tell the whole story. Real world use cases often vary significantly from the “in a vacuum” style testing used for benchmarking. This 2015 Speedemy article did a great job of demonstrating just that and framing the Apache vs Nginx conversation in a more practical context.
While the testing did confirm that Nginx blows Apache out of the water when it comes to delivering static content, it also demonstrated the fact that Apache can be configured to use memory almost as efficiently as Nginx and actually match Nginx in terms of speed while serving dynamic content.
All that being said, what we have established thus far is that with some configuration Apache can do almost as good as Nginx. At the end of the day, almost as good doesn’t justify use. So, apart from the aforementioned scenario as a back-end server with something like Nginx on the front-end, where does Apache make sense and how can it be justified as a practical solution in a modern IT environment?
This hostingadvice.com article serves as a good source of answers to that question, pointing out that Apache outshines Nginx in terms of operating system support and flexibility in the form of support for dynamic modules. It also touches on the htaccess file which can be an advantage depending on the use case and support.
Support is an area in which we’d Apache has a clear advantage. Apache has been around long enough to build a community of support that outstrips most web technologies. In a world where the first thing we do when we hit a problem is “Google it”, that’s a huge competitive advantage.
The size of the support advantage is exemplified by the fact that the number of “Apache” tags on StackOverflow almost triple the number of “Nginx” tags. Many web applications won’t generate enough traffic for Nginx's performance and scalability advantages to shine, but getting quick answers to real world problems can make or break a project on a deadline.
So… is it time to dump Apache?
No. While the answer to this question may change in the next three to five years, at current, there are still too many viable use cases where Apache makes sense to write it off completely.
The wise choice here, as with most other decisions in the world of technology, is to consider the requirements of your environment and resources and select the solution that works best for your team. This could mean choosing a LAMP or LEMP server, a combination of Apache and Nginx, or maybe even IIS.
Regardless of the services, operating systems, and databases you choose to design your applications and infrastructure, it’s imperative that you protect your investment and data by using fast and reliable cloud backups like BitCan.