: This article describes the schematic Nginx-Nginx Process Model 1. for more information about PHP tutorials, see. After normal execution, Nginx will have multiple processes, the most basic of which are master_process (that is, the monitoring process, also known as the main process) and worker_process (that is, the working process), and may also have Cache-related processes. These processes communicate with each other to transmit some information (mainly to monitor processes to work processes ). In addition to mutual communication between processes, Nginx also relies on powerful functional modules to communicate with the outside world, such as through upstream to communicate with the back-end Web server, fastcgi to communicate with the back-end application server, etc.
The master process is mainly used to manage worker processes, including the following four main functions:
(1) receive external signals.
(2) send signals to worker processes.
(3) monitor the running status of the woker process.
(4) when the woker process exits (abnormal), the new woker process is automatically restarted.
Woker processes are mainly used to process network events. each woker process is peer-to-peer and independent from each other. they compete for requests from clients. a request can only be processed in one woker process, the number of woker processes is generally set to the number of machine CPU cores.
The above describes the graphic Nginx-Nginx Process Model 1, including some content, and hope to be helpful to friends who are interested in the PHP Tutorial.