NGINX — Architecture

Premkumar M
2 min readJun 4, 2019

NGINX is a web server is used to render the pages that we have developed using HTML, CSS, and JavaScript. It is one of the topmost web servers among the server’s available in the market. NGINX is preferred for its single threaded, event-driven and master-slave architecture. Read the blog to get more information about NGINX.

Architecture:

NGINX follows the master-slave architecture by supporting event-driven, asynchronous and non-blocking model.

NGINX has sliced into three different parts. They are

  • Master,
  • Workers,
  • Cache

Let us have a brief description of the NGINX parts.

MASTER:

As mentioned above NGINX follows the master-slave architecture. It’ll allocate the jobs for the workers as per the request from the client. Once the job allocated to the workers, the master will look for the next request from the client that’s it won’t wait for the response from the workers. Once the response comes from workers master will send the response to the client.

WORKERS:

Workers are the slaves in the NGINX architecture, will heed to the Master. Each worker can handle more than 1000 request at a time in a single-threaded manner. Once the process gets done, the response will be sent to the master. The single-threaded will saves the RAM and ROM size by working on the same memory space instead of different memory spaces. The multi-threaded will work on different memory spaces.

Cache:

Nginx cache is used to render the page very fast by getting from cache memory instead of getting from the server. The pages are getting stored in cache memory on the first request for the page.

Features:

  • Easy Installation and maintenance
  • Improves Performance
  • Reduce the waiting time for users
  • Load Balancing
  • on the fly upgrades
  • Provides HTTP server capabilities
  • Designed for maximum performance and stability
  • Functions for the proxy server

Conclusion:

I hope that you understood about the NGINX architecture and its features. Will see in the next blog. Thank you, readers!

Reference:

https://www.nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/

http://www.aosabook.org/en/nginx.html

--

--