Try our new research platform with insights from 80,000+ expert users
it_user240036 - PeerSpot reviewer
Senior IT Architect at a university with 5,001-10,000 employees
Vendor
Apache vs. Nginx

Originally posted https://zitseng.com/archives/10435

Apache or Nginx. This is a question that many website administrators have considered. It’s a question that I’ve also considered several times, and again just the past week. Apache is the most popular web server on the Internet. Nginx, on the other hand, is designed for crazy fast performance. Fast is always good to have.

I’ve been making some incremental changes to my website. It’s all under the hood. One thing that inevitably surfaces is about performance. I’ve been using Apache from the beginning. It’s completely functional, and does everything I need it to do. It might not  be the fastest web server software, but it’s no slow coach either.

Nginx is the newer kid on the block. It was first released in 2004, so it’s not really all that new anymore. It does have a reputation for performance, both in terms of raw speed and ability to scale to significant load.

But is Nginx really faster? I know it’s popularly believed to be faster than Apache, but I’m the sort who must try, see, and believe. Well, at least if it’s something practical that I can do.

My test would be on my live WordPress blog website. It is a typical LAMP setup: Linux, Apache, MariaDB and PHP (via mod_php). On the exact same system, I installed and configured Nginx. Since there’s no equivalent of mod_php in Nginx, I took the opportunity to move from mod_php to php-fpm. So at this point, everything’s absolutely identical, and I can just switch between Apache and Nginx anytime with ease.

You know what? I found negligible difference between Apache and Nginx. My test was merely intended to replicated the realistic type of volume my website handles. It isn’t a lot. I was more concerned about the speed at which the web server could respond to requests. I had expected to see some clear wins with Nginx. But no.

Perhaps Apache has caught up with Nginx. I didn’t see much difference in memory utilisation either. Yes, that’s another surprise for me.

If you must know, Apache actually came out slightly better, but it’s only less than 3% faster than serving requests and just about 3% better at memory.

Just to shed a bit more information, my Apache is version 2.4.6, not the latest at all, but I do use their new mpm_event worker. This is the latest of Apache’s multiprocessing model.

I made up my own test suite, in case you were wondering. Many people like to use Apache’s ab, but ab cannot handle testing of mixed URLs, which would be more realistic since a website will contain a mixture of resource types. Nevertheless, I did run Apache ab as well to get a sense of its numbers. There are some numbers, hitting the WordPress main index page.

  Apache Apache Nginx Nginx
  C=4 C=8 C=4 C=8
Requests per sec 2.56 2.64 2.61 2.63
Mean time per request (ms) 1564 3003 1530 3040
Transfer rate (kB/s) 105.3 108.6 107.46 108.19
50% of requests served in (ms) 1504 3004 1504 3018
90% of requests served in (ms) 1774 3174 1576 3187
100% of requests served in (ms) 2068 3934 2139 3610

The test were done with concurrency of 4 and 8. I didn’t go for too many, because realistically my website wouldn’t get all that busy.

You see again from the above table that the difference between Apache and Nginx seems rather negligible.

The Nginx tested is version 1.9.12. It’s the latest. Both Apache and Nginx have Google’s Pagespeed module installed. I used the binary package provided for Apache. On Nginx, there’s no package available, so I built Nginx with Pagespeed myself, with this patch to fix some bug with multiple Vary headers being erroneously emitted.

I do find some benefits with Nginx. FIrst, it has HTTP2 support. Apache has it from 2.4.17, but it’s not in any CentOS package repo. HTTP2 has real benefits. I benchmarked on a real Chrome browser. Nginx with HTTP2 was sending pages faster to Chrome than Apache could. HTML page was fully received in 1.5 s on average with Nginx, versus 2 s with Apache. The webpage with all resources gets delivered in 2.6 s with Nginx, verus 3.2 with Apache. Good, Nginx is fast. However, on closer scrutiny, it turns out all the speed advantage basically comes from quicker connection setup. That’s basically a benefit of HTTP2, not of Nginx per se.

It seems to be that whether Apache or Nginx, the web servers themselves aren’t very different. The problem is in other features that I want.

I want Google Pagespeed. It’s really useful in improving content delivery performance, particularly when you’re working with other software and can’t control HTML output by hand.
HTTP2 seems to offer real benefits. Any modern website ought to adopt it now.
So now I’m in a sort of dilemma. I try as hard as possible not to compile stuffs by hand. I can do it if I need, but I prefer not to. It’s tiring to keep stuffs up-to-date. If I want Pagespeed, Apache offers me the advantage of not having to compile stuff by hand. But Apache won’t do HTTP2, not unless I get version 2.4.17 or later, which probably means I have to compile by myself anyway, and that’s precisely what I want to avoid.

There is a Nginx package repo available, up-to-date with version 1.9.12 at this time. HTTP2 is in there. The problem here is that Pagespeed for Nginx needs to be built from source.

CentOS is not going to move ahead with the Apache version. That’s how it is with enterprise Linux distros. I dislike Ubuntu, but I’m spying that their next 16.04 LTS release appears to include Apache 2.4.17. The current Ubuntu 15.10 does not. So I’ve got no solution with Ubuntu either. 16.04 won’t be that long a wait though.

Decisions, decisions.

At time of this writing, I have Nginx running. Built from source, so that I can get Pagespeed.

I think the surprising take-away for me is that Nginx is practically not faster than Apache, HTTP2 aside.

Disclosure: I am a real user, and this review is based on my own experience and opinions.
PeerSpot user
Real User
Top 10
Highly valuable, stable, and bug-free
Pros and Cons
  • "Apache has proven to be incredibly reliable, and everything has operated smoothly without encountering any issues."
  • "Adding a reverse proxy to Apache Web Server would be a significant improvement."

What is our primary use case?

I mainly use the product for hosting websites, content delivery, and virtual hosting.

How has it helped my organization?

I have been using  Apache to host my clients' web-based applications on the Internet for many years. Throughout this time, Apache has proven to be incredibly reliable, and everything has operated smoothly without encountering any issues. 

What is most valuable?

The web server has been highly valuable, stable, and it has been bug-free.

What needs improvement?

In terms of improvement, Apache should work better with modern cloud and proxy systems like Kubernetes. Right now, it is not very compatible with them. Additionally, adding a reverse proxy to Apache Web Server would be a significant improvement.

For how long have I used the solution?

I have been using Apache Web Server for quite some time.

What do I think about the stability of the solution?

It is a very stable product. I would give it a ten out of ten for stability.

What do I think about the scalability of the solution?

Scalability is a huge problem for Apache. I would rate it a one out of ten.

How are customer service and support?

Apache has good community support, but there is a lack of corporate support options.

How was the initial setup?

The initial setup is simple.

What was our ROI?

I have definitely seen ROI with Apache.

What's my experience with pricing, setup cost, and licensing?

Apache is free.

What other advice do I have?

I would definitely recommend Apache Web Server to anyone who is considering using it. Overall, I would rate it a ten out of ten.

Which deployment model are you using for this solution?

Hybrid Cloud
Disclosure: I am a real user, and this review is based on my own experience and opinions.
PeerSpot user
Buyer's Guide
Apache Web Server
December 2024
Learn what your peers think about Apache Web Server. Get advice and tips from experienced pros sharing their opinions. Updated: December 2024.
824,067 professionals have used our research since 2012.
Owner at Lucracorp
Real User
Top 5Leaderboard
Provides good stability and helps in building websites efficiently
Pros and Cons
  • "Apache Web Server is free of cost."
  • "The product's initial setup process could be easier for users."

What is our primary use case?

I use Apache Web Server to build websites.

What is most valuable?

Apache Web Server is free of cost.

What needs improvement?

The product's initial setup process could be easier for users. 

For how long have I used the solution?

We are using Apache Web Server’s version 2.4.57.

What do I think about the stability of the solution?

I rate the platform’s stability a ten out of ten.

How was the initial setup?

Apache Web Server’s initial setup process is complex for users. However, it is straightforward for server administrators. It takes a few minutes to complete.

What about the implementation team?

We have implemented the product with the help of our in-house team.

What's my experience with pricing, setup cost, and licensing?

There is no licensing cost for the product. It is free to use.

What other advice do I have?

I rate Apache Web Server a ten out of ten. I did an online course to learn how to use the product. I recommend it to users who want to build websites.

Disclosure: I am a real user, and this review is based on my own experience and opinions.
PeerSpot user
reviewer1283880 - PeerSpot reviewer
CEO International Business at a tech services company with 1,001-5,000 employees
MSP
Top 5
Excellent stability, security, and versatility, but its configuration complexity can be a drawback compared to more lightweight alternatives
Pros and Cons
  • "The most significant advantage is the ability to swiftly enable HTTPS services when my DNS is configured correctly."
  • "By optimizing the infrastructure to allow the webserver to directly handle queries from memory—particularly by prioritizing the storage of queries in memory and processing them through the web server interface—I could potentially cut down the required instances from five hundred to two hundred."

What is our primary use case?

We use it for all our web deployments, making it our preferred choice across various projects.

What is most valuable?

The most significant advantage is the ability to swiftly enable HTTPS services when my DNS is configured correctly. This quick resolution and high performance are immensely beneficial for our operations.

What needs improvement?

By optimizing the infrastructure to allow the webserver to directly handle queries from memory—particularly by prioritizing the storage of queries in memory and processing them through the web server interface—I could potentially cut down the required instances from five hundred to two hundred. This optimization represents substantial savings, eliminating the need for deploying three hundred web servers. If we consider a time-saving of, for instance, half an hour per web server, this efficiency enhancement not only boosts performance but also decreases the total number of web server deployments.

For how long have I used the solution?

I have been working with it for approximately fourteen years.

What do I think about the stability of the solution?

It's an extremely reliable web server that performs its tasks exceptionally well.

What do I think about the scalability of the solution?

The server effortlessly scales up by spinning up new instances, making continuous operations and tasks more manageable.

What about the implementation team?

The deployment process typically takes around eight minutes.

What was our ROI?

The return on investment is evident in the significant reduction in time to market and rollout. Even a saving of twenty minutes or half an hour per web server makes a notable impact.

Which other solutions did I evaluate?

In terms of competition, there's NGINX. It also performs admirably, and the two are quite comparable. Some individuals even rate NGINX higher than Apache.

What other advice do I have?

Overall, I would rate it seven out of ten.

Disclosure: I am a real user, and this review is based on my own experience and opinions.
PeerSpot user
Information Security Consultant to the CRO at a financial services firm with 201-500 employees
Real User
Can be done in a cluster configuration and is very scalable
Pros and Cons
  • "Its community is its most valuable feature. Solving problems is easier on Apache because so many people know this product."
  • "A monitoring interface would be great for this product. The monitoring dashboards for Apache's models are not included in the basic installation. You can install the basic monitoring model, then connect this model to another monitoring system."

What is our primary use case?

I have used it for PHP web servers and also as a proxy for Java application servers. I have used the Apache model for the Java infrastructure.

What is most valuable?

Its community is its most valuable feature. Solving problems is easier on Apache because so many people know this product. It's the most iconic, used web server in the world that I know.

What needs improvement?

The improvement can be done in the versions. Even though there are newer, stabler versions available, if you are installing from a data center, you have to install the older version. Then, installing the newer version is uncomfortable as it has to be done manually.

A monitoring interface would be great for this product. The monitoring dashboards for Apache's models are not included in the basic installation. You can install the basic monitoring model, then connect this model to another monitoring system.

For how long have I used the solution?

Five years.

What do I think about the stability of the solution?

It is stable.

With Apache, you can't update the system. There is a big gap between models. I don't like this.

What do I think about the scalability of the solution?

You can do it in a cluster configuration, and it is very scalable.

We have 5,000 users.

How are customer service and technical support?

I have not used the technical support.

Which solution did I use previously and why did I switch?

I have used a number of servers. Previously, I used NGINX. I switched to Apache because it has model and is more flexible.

How was the initial setup?

The initial setup is easy.

It took 15 minutes to deploy.

What about the implementation team?

I deployed the solution myself.

What other advice do I have?

I would recommend the solution to others.

I would rate this solution as a nine (out of 10).

Which deployment model are you using for this solution?

On-premises
Disclosure: I am a real user, and this review is based on my own experience and opinions.
PeerSpot user
Founder at Simpro Tech
Real User
Top 5Leaderboard
Good scalability and works efficiently in running multiple ports on various platforms
Pros and Cons
  • "The solution's most valuable feature is reporting."
  • "Its stability could be better."

What is most valuable?

The solution's most valuable feature is its ability to run multiple ports on various platforms of the application with ease.

What needs improvement?

The solution's stability needs improvement.

For how long have I used the solution?

I have been using the solution for seven years.

What do I think about the stability of the solution?

I rate its stability as an eight. It could be even better.

What do I think about the scalability of the solution?

It is a scalable solution.

How was the initial setup?

The solution's initial setup was straightforward. It also provides a cross-platform deployment to run it on Linux and Windows. As a beginner, the installation process took me two days to complete. But it was much easier later as I got exceptionally equipped with it. Also, deploying it on a standalone system takes a lot of work. Comparatively, I found it easy to deploy it as a module using XAMPP.

What about the implementation team?

We implemented the solution in-house.

What's my experience with pricing, setup cost, and licensing?

We don't have to pay for the solution's license. It is an open-source tool.

What other advice do I have?

I rate the solution as an eight.

Which deployment model are you using for this solution?

On-premises
Disclosure: I am a real user, and this review is based on my own experience and opinions.
PeerSpot user
Managing Consultant at Cyberwise
Vendor
Open source, reliable and configurable
Pros and Cons
  • "It's reliable, configurable and generally secure."
  • "Lacks integration with some cloud solutions."

What is our primary use case?

I have two use cases for Web Server; the first is for my personal use which is developing websites and the second is for the company where we provide solutions support. We are customers of Web Server and I'm a management consultant. 

What is most valuable?

The solution is open source, reliable, configurable and it's mostly secure. 

What needs improvement?

I think there are some features that could potentially be improved in Apache App Store. I'd also like to see some cloud solutions integrated with Web Server. 

For how long have I used the solution?

I've been using this solution for 20 years. 

How was the initial setup?

The initial setup is straightforward. 

What other advice do I have?

I rate this solution eight out of 10. 

Disclosure: I am a real user, and this review is based on my own experience and opinions.
PeerSpot user
System Administrator at Confidential
MSP
Useful in deploying servers to host websites with good modularity
Pros and Cons
  • "It's very stable, and it hosts one of the biggest of many biggest web applications in the world."
  • "There is a security-related problem that depends on the web server's configuration."

What is our primary use case?

It is utilized as a simple web server, meaning you can configure it and use the HTTP or HTTPS protocol. This is the secure version of the HTTP protocol to host or manage the connections from users who want to access the web application, from the internet, and from our local users.

What is most valuable?

The modularity of the application is good. It allows us to use a modular approach, meaning that not all features are hard-coded inside the application, but we can use modules so that these features can be enabled or disabled. If we don't want to use some features, we don't load or enable them inside the configuration file.

What needs improvement?

Nginx is another web server solution that can be used as an accelerator when you want a high-performance web server. Nginx can also be used as a reverse proxy and a cache server to accelerate the response times for all users. If we compare Nginx with Apache Web Server, Apache Web Server cannot be used when high performance is the key feature of your application. If we want to handle many users, choosing Nginx rather than the Apache Web Server is better. However, when you want to scale the application, it is not as good as Nginx and Nginx can handle more users than the Apache Web Server.

For how long have I used the solution?

We have been using this solution for a long time. We use it to deploy servers that host websites. We are using the latest version. It is deployed on-premises.

What do I think about the stability of the solution?

It's very stable, and it hosts one of the biggest of many biggest web applications in the world. It is used widely by many companies. Since they are still using it, I think it's still stable, and we don't have a problem with our application when they're using the Apache Web Server.

What do I think about the scalability of the solution?

Apache can be scalable, but not by using a native feature of Apache. Instead, you have to rely on other tools to set the scalability feature. This is the same for Nginx.

How are customer service and support?

They have community support. It's an organization that handles some open-source because Apache Web Server is a project handled and maintained by the company organization or the Apache Foundation. They maintain the source code and versions. We don't create a ticket with the Apache Foundation, but we will rely on a large community of experts.

How was the initial setup?

The initial setup was straightforward and depended on the operating system. If it's Windows, it is simple when installing. On Linux, it's also straightforward, especially if you want to use specific packages. For example, if you are using Central West Linux or Uganda, they provide a package specific to that distribution. So with a simple command, you can install the Apache Web Server, and all its dependencies will be installed as well.

The configuration is complicated compared to the installation. However, if you need a lot of knowledge about the HTTP protocol, how websites work, and how each module of Apache can work or talk with other modules, it is handled by the core service of the attachable server. The configuration is done by the person or department that deploys the application in the server, so they configure the Apache Web Server.

Maintaining requires two people, myself and another colleague. If another company develops an application, it will maintain the Apache Web Server. But we only maintain the operating system, installing updates and system configurations. But the maintenance of the Apache Web Server and the work application is made by that company, not us.

What's my experience with pricing, setup cost, and licensing?

There is no licensing cost because it is open source.

Which other solutions did I evaluate?

Regarding web services, two major web servers are available, IIS from Microsoft Windows and Apache Web Server. They are the most used web services all over the world. There is also Nginx. Each service has its scenarios of when it will be used. For small to medium size projects in an organization, they can use Apache Web Server or IIS, but if you want something very powerful, you can switch to Nginx.

What other advice do I have?

I rate this solution an eight out of ten. Regarding advice, there is a security-related problem that depends on the web server's configuration. If you install the web server, it works, and you can put your web application in a directory that Apache Web Server reads from to display the web application.

The default installation comes with a default configuration. With default configuration comes security flaws, so you need to set permissions in the configuration file in your website directory. Before you deploy your application with Apache Web Server, you need to know how to configure a web server, how the HTTP protocol works, and how communication between the client and the server works.

If you don't know how to configure everything in a web server, sometimes your server can hang unexpectedly. Sometimes your website won't work as expected, and you will create or offer malicious persons to have access to your web server. If they have access to the web server, they can access every server in the organization because the web server is like the front door. If it's properly secured, it will be difficult for malicious people to enter your organization, but bad things can happen if it's not very secure.

Regarding features, Apache offers a module that will change the behaviour of the Apache Web Server, including some security features that will protect your application from the most used web attacks. It will act like a web firewall where you configure your Apache Web server to protect your web application from widely used attacks on the web. The feature is called Security Mode. It's a module that you can install and act as a web firewall called the WAF (Web Application Firewall), which will not only serve the client but will check their request to see or detect if they are part of an initiated attack or not.

Disclosure: I am a real user, and this review is based on my own experience and opinions.
PeerSpot user
Buyer's Guide
Download our free Apache Web Server Report and get advice and tips from experienced pros sharing their opinions.
Updated: December 2024
Product Categories
Application Infrastructure
Buyer's Guide
Download our free Apache Web Server Report and get advice and tips from experienced pros sharing their opinions.