How to analyze the reason that the php-cgi process is consuming too much CPU resources

Source: Internet
Author: User
Tags file system

Server environment: Redhat Linux 5.5, Nginx, phpfastcgi

In this environment, the general php-cgi run is very stable, but also encountered php-cgi take up too much CPU resources and cause the server response is too slow, encountered php-cgi process too much CPU resources are due to:

Some PHP extensions are compatible with the PHP version of the problem: Practice has proved that eaccelerater with some version of PHP compatibility problems, the specific performance is to start the php-cgi process, run more than 10 minutes, very slow, but static resources access quickly, the server load is also very normal ( Explain Nginx no problem, but the php-cgi process of the problem), the solution is to ban the Eaccelerater module from the php.ini, and then restart the php-cgi process.

There may be a dead loop in the program, causing the server to be overloaded (using the top command to see the load up to 100+) and need to use the Linux proc virtual file system to find specific problem programs.

PHP program unreasonable use of session, this occurs in the open source micro-blog Diary Dog program, the specific performance is a small number of php-cgi process (not more than 10) CPU utilization up to 98%, server load between 4-8, the problem of resolution, Still need to use the Linux proc file system to find out why.

There is an overly time-consuming and impossible operation in the program (or a problem with the program).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.