Iis-how to thoroughly optimize the php program to reduce CPU usage?

Source: Internet
Author: User
Tags high cpu usage
IIS7.0ISAPIPHP5.2.17MysqlZendOptimizer, however, a serious problem is the high CPU usage... running Environment
  1. IIS7.0 ISAPI
  2. PHP5.2.17
  3. Mysql
  4. ZendOptimizer
Program description

Multiple programs run in the same server environment. The program is a set of old programs that have been used for a long time. Currently, it is optimized for problems that may occur, however, a serious problem is that the high CPU usage needs to be solved urgently. The program is a quick site creation solution, and the homepage is a drag layout. During this period, when editing and adding materials, feedback the website card and view the server environment. The CPU usage is very high, and then the website gets stuck, you can only restart the server.

Guess
  1. This error occurs when the template program is downloaded remotely.
  2. Background Data Operations
  3. New module drag layout on Homepage
Solution

How to locate which program segments will cause high CPU usage?

Reply content: running environment
  1. IIS7.0 ISAPI
  2. PHP5.2.17
  3. Mysql
  4. ZendOptimizer
Program description

Multiple programs run in the same server environment. The program is a set of old programs that have been used for a long time. Currently, it is optimized for problems that may occur, however, a serious problem is that the high CPU usage needs to be solved urgently. The program is a quick site creation solution, and the homepage is a drag layout. During this period, when editing and adding materials, feedback the website card and view the server environment. The CPU usage is very high, and then the website gets stuck, you can only restart the server.

Guess
  1. This error occurs when the template program is downloaded remotely.
  2. Background Data Operations
  3. New module drag layout on Homepage
Solution

How to locate which program segments will cause high CPU usage?

There is a problem with IIS. I was drunk when I saw IIS. And PHP5.2. Western Digital server? And is it configured in one installation package? It is not a manually configured environment! It is exactly the same as I met d last month. A fucking client of IIS. The server crashes once every 10 minutes. Lao Tzu restarts once every 10 minutes. PHP has encountered a access violation at XXXXXXX. It was okay to move to liunx later. For PHP, you should leave it to Liunx. Otherwise, you will suffer. No. Let's take a look at the problem. There are many online sayings.
The first is a php bug! This statement comes from outside China. This problem only occurs in PHP on win. The solution is to upgrade the PHP version. Or gai server system.
The second argument is about mysql configuration. Need to change the sequence of environment variables?
The third statement is that the mysql extension of PHP is incorrect. To be placed in system 32
4th are program problems. But I think your program is old code. It takes a long time to run. And has been tested. In this case, the code is less likely to investigate the problem.

Sao Nian. Troubleshoot the problem.

CPU usage is high, which generally means there are a lot of computing or endless loops. You can try to use xhprof for analysis.

CPU usage and high availability are analyzed from these aspects.
1. There are a large number of operations and unlimited operations.
2. Script Execution is time-consuming, such as image processing.
3. For environment problems, use the LAMP classic combination. Environment configuration see http://lnmp.org/install.html

Please stop using LAMP or LNMP for windows.

In additionThoroughWrite your own php module in the underlying Language

Using ISAPI is indeed a self-seeking headache. The only way Microsoft officially supports the configuration of PHP in IIS is FastCGI,

Https://secure.php.net/manual/en/install.windows.iis7.php

The lifecycle of PHP 5.2 has already ended, and continuing to use it is another headache for self-searching.

Https://en.wikipedia.org/wiki/PHP

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.