Popular understanding of the relationship between CGI, FastCGI, php-fpm?

In layman's terms, the server can be regarded as a restaurant, the user's request can be regarded as a customer who comes to dine, and the server's processing request can be regarded as solving the customer's dining problem (response and output a meal). The static resources on the server are regarded as ready meals, and they can be returned to customers as long as they are placed in the lunch box. The dynamic resources need to be prepared by the kitchen chef and then returned to the customers in the lunch box.

The chef of php_mod has a characteristic. When he sees a customer entering the door, he will set it on fire. No matter whether the customer wants to make it or not, it is a bit of a waste of resources.

The chef of php_fpm has many younger brothers who have been lighting the fire (multiple processing processes), and when a customer says they want to make it now, the chef arranges for the younger brother to make a copy and return it to the customer

cgi is also a master chef, but he waits until the customer wants to cook it, then he lights it up, cooks it, and then turns it off. Waiting for the next one to come

As for fastcgi, a chef hired a group of younger brothers to make meals that need to be cooked on the spot. The chef just assigns tasks, and the younger brother really cooks.

Reference resources:

https://segmentfault.com/q/1010000000256516



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325565638&siteId=291194637