This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14100|Reply: 1

[Web] What is the difference between php-cgi and php-fpm?

[Copy link]
Posted on 10/24/2014 10:51:23 AM | | |
Many people have seen php-cgi and php-fpm processes without knowing the difference

Actually, I don't know

I did a little Baidu, and here is what others said:

cgi is inefficient, every time a PHP request comes, a new PHP process is created to parse, the process is destroyed after parsing, and then the process is requested to start again...
fpm=fastcgi process manage, maintain a certain number of processes for nginx calls, so you don't need to create a new process every time, which is faster. The principle is somewhat similar to a database connection pool.






Previous:The CNC machine tools in Germany are too awesome, look at the craftsmanship of foreigners
Next:Lincoln Park love~
 Landlord| Posted on 10/24/2014 11:00:50 AM |
PHP-FPM is very convenient to use, the configuration is in the PHP-FPM.ini file, and the startup and restart can be done from php/sbin/PHP-FPM. What's more convenient is that after modifying the php.ini, you can directly use PHP-FPM reload to load it, and you can complete the php.ini modification loading without killing the process
The results show that using PHP-FPM can improve the performance of php a lot. The CPU recovery speed of the process controlled by PHP-FPM is relatively slow, and the memory allocation is very even.
Spawn-FCGI-controlled processes have a fast CPU drop, while memory allocation is uneven. There are many processes that seem unassigned, while others are highly occupied. It may be due to uneven distribution of tasks in the process. This has led to a decrease in overall response speed. And PHP-FPM is reasonably allocated, resulting in the mention of the overall response as well as the average of the task.
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com