Reading 07 - theSam1998/ops-301-Reading-Notes GitHub Wiki
Reading 07
Relevance statement:
NGINX is a highly powerful and versatile software that, while built initially to be the fastest webserver possible, can be used for a great number of other purposes that will improve the performance of a website or application. It is a crucial component of the infrastructure of some of the most famous apps and websites, and some of the biggest tech companies worldwide use it extensively. As a result, it is vital for us to learn to work with it and learn how it works as cybersecurity professionals.
What are some common use cases for NGINX?
NGINX is first and foremost used as a web server, as it was originally designed to be the fastest web server, and evolved along the way. NGINX can serve static files extremely quickly, and uses an event-driven, asynchronous architecture, which lets it manage multiple tasks at once without waiting for each one to be completed individually. As a result, it can handle doling these files out to their respective clients extremely quickly, and for many clients at once. NGINX is used by companies like Netflix, Soundcloud, Github, and even giants like Microsoft and Apple. The list goes on and on, if you can think of a company, it is likely it is using nginx.
Another common use is as a reverse proxy, handling incoming requests from clients and forwarding them to the appropriate servers. This can help balance the load throughout the network and improve system performance overall. Playing off that last statement, it can also serve as a load balancer, distributing the traffic across multiple servers to improve the responsiveness and availability of the website it powers.
ChatGPT4🤖: More common uses: In addition to these use cases, NGINX can also function as a mail proxy server, supporting IMAP, POP3, and SMTP protocols. It can be used as an API gateway, managing how clients and applications communicate with each other. Moreover, with its support for WebSocket, HTTP/2, gRPC, and multiple video formats, NGINX is well-suited to serve modern, dynamic web applications.
How does NGINX handle tasks that could slow down the web server?
As stated in the previous section, NGINX's architecture itself makes it extremely good at handling a large number of clients and distributing traffic efficiently across the network. NGINX can serve as an SSL/TLS terminator, taking on the highly taxing task of negotiating SSL/TLS handshakes, or act as a caching server, storing frequently accessed content and reducing the need for redundant traffic. Along with its functionality as a load balancer, and reverse proxy, NGINX can serve to significantly improve network/application performance.
Describe, as if to a non-technical friend how to actually pronounce “NGINX”, and why an org might chooose to use it.
NGINX (pronounced "engine x") is an extremely versatile piece of software designed to host websites. It started off as a tool designed to manage a large number of people trying to access a website at the same time, and has gradually evolved into the fastest, most powerful and most versatile web server available. NGINX is already used by a great number of companies you are likely familiar with to host their websites and applications, such as Netflix, Hulu, Soundcloud, and nearly any other company you can think of that relies on fast delivery of media as a service (this even encompasses companies like airbnb!), along with some of the biggest names in the industry such as Microsoft and Apple. These companies choose to use NGINX because of its efficient methods for handling massive amounts of network traffic, its versatility, and its overall ease of use. But mostly, at its core, NGINX relies on an architecture that makes it extremely good at delivering large amounts of media to a large number of users simultaneously.
Things I want to know more about
What are some more outside the box uses for NGINX? I want to know some of its strangest use cases that have brought unique success.
ChatGPT4🤖: In addition to the common use cases, NGINX can also serve as an Internet of Things (IoT) gateway. Given its ability to handle a large number of simultaneous connections, NGINX can manage data flow between IoT devices and backend systems. It can also be used in microservices architectures due to its reverse proxy capabilities, enabling efficient service discovery and routing.
What exactly is "event-driven, asynchronous architecture"? I understand what it does, but I am sure the name is relevant to a greater architecture system, and I would like to know more about it.
🤖Event-driven, asynchronous architecture: This is a programming paradigm applied to software development, where the flow of the program is determined by events - such as user actions, sensor outputs, or messages from other programs. In the context of NGINX, this means that it does not need to dedicate a single thread to each connection (as traditional thread-based servers do), but rather it can handle many connections within a single thread. This makes it highly efficient and capable of serving thousands of simultaneous connections with minimal resource usage.
What was the c10k problem, and how was network architecture structured differently to accomodate large amounts of traffic back when this was a pressing issue?
🤖The c10k problem: The c10k problem is a term coined in the late 1990s by Dan Kegel to describe the challenge faced by server software when trying to handle 10,000 simultaneous connections, which was considered a high number at the time. Traditional thread-based servers struggled with this volume of connections due to the overhead of creating a new thread for each connection. NGINX was one of the first servers to effectively address the c10k problem, by using an event-driven, asynchronous architecture, as explained above. This allowed NGINX to handle many connections within a single thread, thereby significantly reducing the resources required to serve a high number of simultaneous connections.