For 20 years, Apache has dominated the shrinking Web server market. Nginx not only caught up with the oldest child in the neighborhood, but it is currently a toast to many high-traffic websites. Apache users may disagree with this. This is why one should not draw conclusions about which Web server is better. The fact is that both constitute the core of the complete network stack (LAMP and LEMP), and the final choice boils down to personal needs.
For example, people who run Drupal sites often turn to Apache, and WordPress users seem to like Nginx as much or more. Therefore, our goal is to help you better understand your requirements, not to provide a single size recommendation. Having said that, the following comparison between the two gives an accurate picture.
1. Popularity
Until 2012, more than 65% of websites were based on Apache, and its popularity was mainly attributed to its historical heritage. It is one of the first software to promote the development of the World Wide Web. However, times have changed. According to W3Tech.com data, as of January 14, 2019, Apache (44.4%) is slightly ahead of Nginx (40.9%) in terms of websites that use its servers. Among them, they occupy almost 85% of the Web server market.

When it comes to high-traffic websites, the chart below is interesting. Of course, Nginx is far ahead of Apache, but it lags behind the Google servers that provide support for sites such as YouTube, Gmail, and Drive.

At some point, a large number of websites (including this site) migrated from Apache to Nginx. Obviously, the latter is regarded as the newest and most modern web server. High-traffic website on Apache, p. For example, Wikipedia and The New York Times often use front-end HTTP proxies like Varnish.
Score: The popularity gap between Apache and Nginx is rapidly closing. However, due to the large number of Apaches, we treat this round as a tie.
2. Speed
The main characteristic of a good web server is that it must work quickly and can easily respond to connections and traffic from anywhere. To measure server speed, we compared two popular travel websites based on Apache (Expedia.com) and Nginx (Booking.com). Using an online tool called Bitcatcha, multiple servers were compared and measured against Google’s 200 millisecond benchmark. Nginx-based Booking.com was rated “extremely fast.” In contrast, Apache-based Expedia.com was rated “above average and room for improvement.”
After using these two travel websites so many times, I can personally guarantee that Expedia will return the results to my inquiries a little slower than Booking.

Here are comparisons between the two servers for a few other websites. Nginx does feel faster in all cases below except one.

Score: Nginx wins the speed round.
3. Security
Both Nginx and Apache attach great importance to website security. There is no shortage of powerful systems to deal with DDoS attacks, malware, and phishing. Both regularly issue security reports and recommendations to ensure enhanced security at all levels.
Score: We will consider this round a tie.
4. Concurrency
There is a perception that Apache somehow cannot reach the sheer scale and capabilities of Nginx. After all, Nginx was originally designed to speed up the FastCGI and SCGI controllers. However, as of Apache 2.4 (which is the default version), the number of concurrent connections has improved significantly. It is worth checking how much progress has been made in this improvement.
Based on the Loadimpact.com stress test, we again compared Booking.com (Nginx) and Expedia.com (Apache). For 25 virtual users, the Nginx website can log 200 requests per second, which is 2.5 times Apache’s 80 requests per second. Obviously, if you have a dedicated, high-traffic website, Nginx is a safer option.

Score: Nginx wins the concurrency round.
5. Flexibility
The web server must be flexible enough to allow customization. Apache does a great job with the .htaccess tools that Nginx doesn’t support. It allows the decentralization of the responsibilities of the administrators. You can prevent secondary and third-party administrators from accessing the primary server. Additionally, Apache supports more than 60 modules, which makes it highly scalable. Apache is more popular among shared hosting service providers for a reason.
Score: Apache wins this round.
Other Parameters
In the past, Nginx was not compatible with the Windows operating system, unlike Apache. This is no longer the case. In addition, Apache was considered weak in load balancing and reverse proxy, which has now changed.
Final Result
Nginx won the game by a narrow margin 21. Having said that, the objective comparison between Nginx and Apache in terms of technical parameters cannot give a complete picture. In the end, our conclusion is that both web servers are useful in their own ways.
Although Apache should be used with front-end servers (Nginx itself is an option), Nginx can do better with more customization and flexibility.
No Responses