the normal execution of Nginx will have a number of processes, the most basic master_process (that is, the monitoring process, also known as the main process) and worker_process (that is, the work process), there may be cache-related processes. These processes communicate with each other in order to pass some information (mainly the monitoring process is passed to the worker process). In addition to the communication between their own processes, Nginx also relies on powerful functional modules and the outside world, such as through the upstream and back-end WEB server communication, relying on fastcgi and back-end application server communication, etc.
the master process is primarily used to manage worker processes, including the following 4 main features:
(1) Receiving signals from the outside world.
(2) Send a signal to each worker process.
(3) Monitor the running state of the woker process.
(4) When the Woker process exits (in exceptional cases), the new Woker process is restarted automatically.
Woker process is mainly used to deal with network events, each woker process is peer and independent, they are equally competitive from the client's request, a request can only be processed in a woker process, the number of Woker process is generally set to the number of machine CPU cores.
The above describes the graphical Nginx-nginx process Model 1, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.