CGI

Common Gateway Interface Public Gateway Interface. The protocol that the Web Server interacts with the background language, and they can communicate with each other.

CGi forks a new process each time it processes a request and kills it at the end. As the high concurrency business grows, FastCgi replaces CGI

FastCGI

As the name implies, fast CGI, which allows multiple requests to be processed in a process without terminating the process at the end of a request. Reduce resource and memory consumption by processes.

PHP-FPM

FPM (FastCGI Process Manager) Process Manager. Php-fpm contains two types of processes, master and worker. There is only one master process, which is responsible for listening on the port and receiving requests from the Web Server, while there are generally multiple worker processes (the specific number can be configured according to actual needs).

Each time the master process receives a Web server request, it assigns a task to the child process worker(php-cgi). After the request is processed, the php-CGI process does not close, but continues to wait for the next connection. This is also the principle of fast-CGI acceleration. Because of resident memory, php-CGI basically consumes 7-25M of memory. If too many processes consume too much memory, error 502 is caused.

A graphic quote from The Great God blog.csdn.net/belen_xue/a…






The following is managed without PHP-FPM