Nginx Vs Apache Webserver Performance and Popularity

Windows Articles

How to get the Nextcloud desktop client on Linux?

Hello friends. We already know how to install a Nextcloud server but now the client is missing. So in this post, you...

How to Backup your call and SMS history in Android

Many times we find ourselves in the situation of having to change our phone, for different reasons, and one of the questions...

Install and configure Apache Guacamole on Debian 10

Hello, friends in this post, you will learn how to install and configure Apache Guacamole in Debian 10. It will be a...

Ubuntu 20.10 available

The new version of Ubuntu is now available, under the code name "groovy gorilla". Ubuntu 20.10 focuses on improving and refining the...

Monitoring Ubuntu 20.04 with Stacer

Normally if we use Linux on a production server, it is important to monitor it. On the other hand, in everyday use, many users...
Avatar
Mel Khamlichi
Webmaster and technical Director at Osradar.com Linux/Unix Guru Technology and hardware addicted Location : Amsterdam Netherlands

Apache and Nginx are the two most commonly used open-source web servers in the world. Together, they serve over half of the traffic on the internet and run on the majority of the most popular websites on the web.

While Apache and Nginx share many qualities, there are differences in some areas each excels in its own way and has its own usage scenarios. Perhaps, the biggest difference between Apache and Nginx is the actual way they handle connections, traffic and respond to different traffic conditions.

Connection Handling

Apache:

Apache provides a variety of multi-processing modules (MPMs) that handle clients’ requests – mpm_prefork, mpm_worker, mpm_event – which are basically the three types of requests handling algorithms, each suitable for different server needs/loads. MPMs provide a flexible architecture for choosing different connection and request handling algorithm. Flexibility comes at a cost of resource consumption.

Nginx:

Nginx was designed to use an asynchronous, non-blocking, event-driven connection handling algorithm. It spawns a worker process, each of which can handle thousands of connections. Such connections processing model allows Nginx to scale very fast and wide with limited resources (memory and CPU usage tend to stay relatively consistent, even at times of heavy load).

Static and Dynamic Content

Apache:

Handles static content using its conventional file-based methods. Can also process dynamic content within the web server itself without having to rely on external components through the use of dynamically loadable modules.

Nginx:

Can’t process dynamic content itself. It passes the content (PHP scripts for example) to an external processor for execution and wait for the rendered content to be sent back.

Distributed or Centralized Configuration

Apache

Allows additional configuration on a per-directory basis by interpreting directives in .htaccess files. It is possible to allow non-privileged users to control certain aspects of their website without granting them the permissions to edit the main configuration file.

Nginx:

Does not provide any mechanism for per-directory configuration.

File and URI-Based Interpretation

Both Apache and Nginx have the ability to operate on both the underlying file system and the web space, it leans heavily towards the file system.

Modules

Apache:

Module system allows you to dynamically load or upload modules.

Nginx:

Modules must be selected and compiled into core software, as they are not dynamically loadable.

Using Apache and Nginx Together

You can place Nginx <<in front>> of Apache as a reverse proxy.

Ok, now you know it all. You can proceed to installing Apache or Nginx, it’s your choice. But if we were to choose one, we would recommend Nginx!

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to get the Nextcloud desktop client on Linux?

Hello friends. We already know how to install a Nextcloud server but now the client is missing. So in this post, you...

How to Backup your call and SMS history in Android

Many times we find ourselves in the situation of having to change our phone, for different reasons, and one of the questions...

Install and configure Apache Guacamole on Debian 10

Hello, friends in this post, you will learn how to install and configure Apache Guacamole in Debian 10. It will be a...

Ubuntu 20.10 available

The new version of Ubuntu is now available, under the code name "groovy gorilla". Ubuntu 20.10 focuses on improving and refining the...

Monitoring Ubuntu 20.04 with Stacer

Normally if we use Linux on a production server, it is important to monitor it. On the other hand, in everyday use, many users...
x