Php-cgi process cpu takes up too much resources and solutions

  

Server environment: redhat linux 5.5, nginx, phpfastcgi

In this environment, the general php-cgi operation is very stable, but I also encountered php-cgi taking too much cpu resources and causing the server to respond too slowly. The reason why the php-cgi process encountered too much cpu resources is:

Some php extensions are compatible with the php version. There is a problem: the practice proves that eAccelerater is compatible with some php versions. The specific performance is that after running the php-cgi process, it runs for more than 10 minutes, which is very slow, but the static resource access is very fast and the server load is normal (indicating that nginx does not have The problem, but the problem of the php-cgi process), the solution is to ban the eAccelerater module from php.ini, and then restart the php-cgi process.

There may be an infinite loop in the program, causing the server to be overloaded (using the top command to view the load up to 100+). You need to use the Linux proc virtual file system to find the specific problem program.

php program unreasonable use of session, this happens in the open source microblogging dog program, the specific performance is that a small number of php-cgi process (no more than 10) cpu usage rate of 98% or more, server load Between 4-8, the solution to this problem still needs to find out the reason by using the Linux proc file system.

There are operations in the program that are too time consuming and impossible to complete (or problems with the program).
More related reading "The server php-cgi.exe process, resulting in 100% CPU solution"

Copyright © Windows knowledge All Rights Reserved