Under linux, php has three modes of operation: 1. APACHE2HANDLERPHP
As an Apache module, after the system is started, the Apache server pre-generates multiple copies of the process to reside in memory, once a request appears. , immediately use these spare child processes for processing, so there is no delay caused by the child process. These server copies do not exit immediately after processing an HTTP request, but stay in the computer for the next request. Requests for client browsers are faster and perform better.
2. The CGIcgi method encounters a connection request to create a cgi child process, then processes the request, and ends the child process after processing. This is the fork-and-execute mode. So how many cgi subprocesses there are in the cgi way server? Sub-process repeated loading is the main reason for the low performance of cgi.
3. CGI-FCGIFastCGI is like a long-live CGI that can be executed all the time. Once activated, it won't take time to fork once. PHP uses PHP-FPM (FastCGI Process Manager), fully called PHP FastCGI Process Manager for management.
How FastCGI works 1. Load the FastCGI Process Manager (IIS ISAPI or Apache Module) when Web Server starts. 2. The FastCGI Process Manager initializes itself and starts multiple CGI interpreter processes. -cgi) and wait for a connection from the Web Server. 3. When the client requests to reach the Web Server, the FastCGI Process Manager selects and connects to a CGI interpreter. The web server sends the CGI environment variables and standard input to the FastCGI child process php-cgi. 4. After the FastCGI child process finishes processing, return the standard output and error information from the same connection to the Web Server. When the FastCGI child process closes the connection, the request is processed. The FastCGI child process then waits and processes the next connection from the FastCGI Process Manager (running in the Web Server). In CGI mode, php-cgi quits here.
In the above situation, you can imagine how slow CGI is usually. Every web request PHP must reparse php.ini, reload all extensions, and reinitialize all data structures. With FastCGI, all of this happens only once when the process starts. An added bonus is that the Persistent database connection works.
The method is as follows: 1. Create a new .htaccess file in the directory where you need to use the
electronic device has two types: radiated noise and conducted noise generated from the power cable a
system to establish IPC communication (such as message queue, shared memory) must specify an ID valu
ifconfig -a View all NIC information of Linuxifconfig eth0 down Turn off eth0 network cardifconfig e
linux stack of neighborhood subsystem (two related processes)
What to do if the busybox verification fails
Solve the system problem accurately Linux log management
OpenIPMP test environment installation basic tutorial under Windows
Linux tar.gz, tar, zip, etc. decompress, compress the command
Introduction to three commonly used network security tools under Linux system
The final solution for the Eva qq crash of QQ software under Linux
How to add Nginx to system services
Where is the Win10 temporary file? Win10 automatically cleans up temporary files
Win10 system notification message how to shield
Easily split a desktop into four desktops with Msvdm.dll
How to monitor the overall operation of the program in real time in win7 system
How to modify my document save location in Windows 7
Microsoft began to remove Win8.1 fake apps/games
SFC usage parameters under Win2000/XP
Win7 system wireless network connection is restricted How to handle