Nginx

  1. Nginx is an event driven, high throughput web server. It can be used as a Load balancer.
  2. It supports the following features,
  • Layer 4 & Layer 7 load balancer
  • TLS termination
  • Rate limiting through leaky bucket algorithm
  • Static content serving through it’s cache
  • Reverse proxy

3. It supports rolling update of configuration without dropping any connections or interruption of service. The same goes for upgrading nginx as well.

4. It supports the following protocols,

  • HTTP(S)
  • TCP (TLS)
  • POP3
  • SMTP
  • IMAP

5. It has the following types of processes,

  • Master (Launches various processes, upgrades configuration, binding to ports)
  • Child (or worker -- It does actual traffic handling)
  • Cache Loader (at startup, It loads the content from disk to in memory cache)
  • Cache Manager (It periodically prunes the cache to keep it to a limit)

6. Typically, one worker per core is assigned to avoid context switches. Each worker is a single threaded process handles thousands of connections.

7. In traditional web servers, each connection is mapped to a thread or process. It’s actually an imbalanced mapping. Because connection(represented by file descriptor and small amount of memory) is mapped to a heavy weight thread or process. Hence, web servers quickly hits the limit of compute resources. Nginx takes a different approach here. It allocates single threaded process to handle thousands of connection in event driven way (or non blocking way). This architectural change makes it so powerful.   


To view or add a comment, sign in

More articles by Veeramani Moorthy

  • NoSQL Toolbox
  • RDBMS - Salient points

    Though it’s possible to scale the reads using read replicas, there is a limit to this as you may not go beyond limited…

  • RabbitMQ

    It’s a multi protocol (AMQP, MQTT, STOMP) messaging server written in Erlang. Erlang provides actor based concurrency…

  • Elastic Search

    It’s a distributed, highly scalable, lucene based search engine. Elasticsearch index is sharded and each shard is a…

  • Kafka

    Kafka is a pub/sub system on top of distributed, replicated commit log. Kafka provides higher level abstraction called…

  • Pull vs Push

    Pull: In pull protocols, the client periodically connects to the server, checks for and gets (pulls) recent events and…

  • Load Balancer

    As the name suggests, It’s meant for balancing the load across all servers registered with it. There are 2 dimensions…

  • CAP Theorem

    CAP stands for Consistency Availability & Partition Tolerance. What is availability? Any request sent to non-failed…

Explore content categories