What is Nginx web server and what does it do?

Author: HOSTTEST Editorial   | 12 Sept 2019

nginx WebserverA web server's role is to facilitate communication between a server (host) and an external connection (client), acting as an interface between the two. It receives the request, forwards it to its own system, and sends the response back to the connected computer. The software nginx is a highly flexible, efficient, and stable web server tailored to the needs of large websites with numerous parallel connections and parallel information processing. In terms of speed, it offers significant advantages over the market leader Apache 2, as it employs a different concept in managing and processing individual processes. Both systems have already been compared in this article.

 

Contents:

The nginx web server as a response to the drawbacks of Apache 2
A specialised web server for websites with extremely high visitor numbers
The technical functioning of nginx as a web server
Similarities between nginx and Apache 2 - a modular structure

The nginx web server as a response to the drawbacks of Apache 2

To understand the unique features and advantages of nginx, it is helpful to consider its background and origins. The web server was first released in October 2004 and was created by the Russian programmer Igor Sysoev, who had successfully completed his computer science studies at the Moscow State Technical University ten years earlier. Sysoev tailored his nginx web server to the needs of the Russian search engine Rambler, for which the previously dominant Apache 2 was unsuitable.

The reason lies in the way Apache 2 Webserver manages incoming connections: The web server starts a separate process for each connected client, which in turn consumes both memory and processing power exclusively for itself. This is not a problem with a low to moderate number of requests, but with a large number of parallel connections, efficiency decreases and speed decreases due to the increasing overhead for managing processes. In concrete terms, this means: The more visitors simultaneously access a website with Apache 2 as the web server, the more resources the server needs for each individual visitor.

Find Nginx Web Hosting

Secure web hosting with Nginx web server now

Compare Nginx Web Hosting

A special web server for websites with extremely high visitor numbers

For a website with an extremely high number of visitors and at the same time with a relatively short duration of stay - conditions that almost perfectly match a search engine - the concept of Apache 2 is extremely unsuitable. To meet their requirements, a web server must above all meet the following conditions:

  • Very high efficiency in memory management
  • Simultaneous processing of numerous connections
  • High speed in transferring information
  • Flexible design for differentiation of requests e.g. by origin
  • High software performance
  • Possibility to extend with additional functions
  • Support for load distribution across multiple servers
  • Compatibility with different scripting languages
  • High stability even under critical conditions and with limited resources

These requirements led to the development of nginx as a modular web server, which efficiently manages and processes simultaneous requests from well over 10,000 or 100,000 clients even under high loads.

Find out how Nginx compares to other web servers:

Nginx vs. LiteSpeed
Nginx vs. Apache

The technical functioning of nginx as a web server

An essential difference between nginx and Apache 2 lies in the management of processes that maintain the connection to clients until communication is terminated from one side. Apache 2 starts a separate child process for each client to isolate it from others, thereby ensuring stability. In contrast, the nginx web server bundles requests in one instance and can handle thousands of them through a single child process. This eliminates one of Apache 2's major drawbacks - the exponentially increasing computational overhead required solely for resource management as the number of visitors grows, increasingly limiting the web server in terms of speed and efficiency. A newer competitor also focused on speed is the LiteSpeed Webserver.

For more information on the distribution of market shares among web servers, refer to our Web Server Overview.

Commonalities between nginx and Apache 2 - a modular structure

To optimise software performance, a web server must be as lean as possible at its core and efficiently manage available resources. At the same time, it should be able to adapt to different environments and tasks to provide the necessary flexibility for changing conditions and challenges. Both Apache 2 and nginx achieve this through a modular structure, allowing the main program to be customised and supplemented with different functions and capabilities as needed. These modules cover various categories and serve specific purposes such as:

  • Localisation: Processing requests based on the client's location
  • Interfaces: Integration with external interpreters like scripting languages
  • Compression: Efficient data traffic by compressing information
  • Multimedia: Delivery of images, videos, or streams via special protocols
  • Security: Client identification and authentication
  • Encryption: Application of secure cryptography like SSL and TLS
  • Monitoring: Surveillance and logging for the web server
  • Redirection: Internal transcription of addresses according to defined rules
  • Communication: Extension to support mail or chat protocols

Numerous modules such as encryption according to the SSL standard are an integral part of nginx's basic equipment, while others must be integrated into the web server on request. This highlights another significant difference between nginx and Apache 2. Due to its static structure, nginx - with few exceptions - does not support the dynamic loading of modules as external program parts. They must be firmly integrated during the compilation of nginx, whereas Apache 2 can add, activate, or remove them independently from its core at any time. Some features, such as .htaccess with Nginx, are however not available.

 

Find Nginx Hosting

Secure web hosting with Nginx web server now

Compare Nginx Hosting

 

Photo: dlohner pixabay.com

Write a comment


More web hosts


More interesting articles