Now my service is running in Nginx + FPM mode.
What is the difference between PHP and FPM running with CGI?
PHP Novice to these two concepts do not know very well, ask you.
Reply content:
Now my service is running in Nginx + FPM mode.
What is the difference between PHP and FPM running with CGI?
PHP Novice to these two concepts do not know very well, ask you.
Better with FPM.
CGI is the most primitive way, nginx for each request, create a PHP interpreter process, after processing the request, the process is destroyed.
FastCGI is an upgraded version of CGI, Nginx creates one (or more) persistent processes, processing requests individually, eliminating the overhead of creating and destroying processes.
PHPFPM is the PHP fastcgi Manager, there are a lot of practical functions (such as the flexibility to configure the process pool management policy), should be said to be the best choice for nginx mates.
PHP-FPM is a patch written for the PHP kernel to handle the start, stop, and restart of FastCGI processes as needed .
- Low memory usage (because Nginx does not load the entire PHP environment when running alone).
- Easily manage user permissions (because PHP can manage different users in your server process).
- When PHP crashes, Nginx can run as usual.
Recently, it has been reported that PHP5.4 will most likely have PHP-FPM (PHP FastCGI process Manager) patches included in the kernel.