Book Image

Nginx Essentials

By : Valery Kholodkov, Valery I Kholodkov
Book Image

Nginx Essentials

By: Valery Kholodkov, Valery I Kholodkov

Overview of this book

Table of Contents (13 chapters)

The Nginx connection processing architecture


Before you study the management procedures of Nginx, you need to get some idea of how Nginx processes connections. In the full-scale mode, a single Nginx instance consists of the master process and worker processes, as shown in the following figure:

The master process spawns worker processes and controls them by sending and forwarding signals and listening for quit notifications from them. Worker processes wait on listening sockets and accept incoming connections. The operating system distributes incoming connections among worker processes in a round-robin fashion.

The master process is responsible for all startup, shutdown, and maintenance tasks such as the following:

  • Reading and re-reading configuration files

  • Opening and reopening log files

  • Creating listening sockets

  • Starting and restarting worker processes

  • Forwarding signals to the worker processes

  • Starting a new binary

The master process thus ensures continuous operation of an Nginx instance in the...