Solution to windows2003 100% of CPU resources on a server

Source: Internet
Author: User
Tags iis log sql access database cpu usage high cpu usage access
iis|window|windows2003| Server | solve

The following is Scenario 1:
Phenomenon: When the machine is debugging or allowing IIS to be interrupted by an abnormal interrupt service (such as a power outage), and then IIS runs the page again, CPU resources occupy 100%, even if the reboot is invalid.
Cause: When an interrupt occurs, IIS writes an exception log, but this time it writes a garbled, causing IIS to write a dead loop of the log, exhausting the system resources. Find the error log file for the day under the system path \SYSTEM32\LOGFILES\W3SVC1 to see the above content.
WORKAROUND: Delete the error log file for the day under the system path \SYSTEM32\LOGFILES\W3SVC1, such as: Ex060904.log, and then restart IIS.

The following is Scenario 2:
Environment: Win2003server+iis+asp+mssql
Phenomenon: Every once in a while (indefinite, sometimes a few minutes, sometimes half an hour) a Web site opened very slowly, and sometimes even timeout to open the site, at this point to view the server-side process, the CPU occupancy rate reached 100%, of which w3wp occupy 70~80%,sql occupied 20~30%. All server-side operations have also become slow
Initial solution: Each phenomenon occurs, immediately log on to the server directly to end the W3WP process or restart the IIS service, an average of about 10 operations per day, because the server is stored in the remote computer room, all operations are remote control, and sometimes there will be remote unable to connect to the situation, can only notify the computer room manager to restart the server solution, this process caused users to complain constantly
Through online access to data, found that most of these phenomena due to the unreasonable Web page code, the following circumstances can lead to such a phenomenon:
1, the code in many places using application, seesion, such as server caching, resulting in excessive server data consumption;
2, the code has unreasonable syntax, such as dead circulation;
3, database corruption, especially Access database;
4, install too many third-party software or Plug-ins, and IIS or Web page feature code conflict.
First-stage troubleshooting: Analysis by reference to the referenced resources
1, all site code on the server for the company's designers to write their own, can prove that there is no excessive call server caching syntax (exclusion)
2, the code whether there is unreasonable syntax (not sure)
3, according to the situation, the increase in the IIS process occupancy rate, the SQL occupancy rate increased at the same time, should be the site of the SQL database, according to the phenomenon of judgment, the library or table should be normal, estimated data may be wrong;
4, the server side in addition to the basic system services, anti-virus and web site operation of essential services, and no redundant third-party software, the probability is not (excluded).

Through the above analysis, the uncertainty is linked to the conclusion that a Web page code with SQL database has unreasonable syntax, resulting in high CPU usage of IIS and SQL processes.

The second phase of the investigation:
Determine the scope, and then continue to narrow the scope.
Since there are not many sites using SQL databases on the server, it is easy to establish a separate process ID to observe, all the sites using the SQL database in IIS Manager to establish separate application pool, and then through the CMD interface input: Iisapp-a to view and record the process ID number of each IIS pool, An IIS process ID is the culprit for this problem, as observed over multiple occurrences.

The following is scenario 3:
Under IIS6, frequent w3wp.exe memory and CPU usage cannot be released in time, resulting in slow server response.

To resolve the memory footprint, you can configure the following:
1. Separate application pool configuration for each Web site in IIS. That does not affect each other.
2, set the application pool recovery time, the default is 1720 hours, can be modified according to the situation. Then set the memory to automatically recycle when the memory footprint is more than (500M).

Resolving Excessive CPU Usage:
1. Separate application pool configuration for each Web site in IIS. That does not affect each other.
2, set the application pool CPU monitoring, not more than 25% (server 4CPU), refresh every minute, when the limit is closed.

According to W3wp is the one application pool:
1, in the task Manager to increase the display of the PID field. You can see the process that takes up memory or the highest CPU
2, run iisapp-a at the command prompt. Note that the first run, will be prompted without JS support, click OK. And then you can run it again. This allows you to see the application pool that the PID corresponds to. (Iisapp is actually stored in the C:\windows\system32 directory of a VBS script, full name for Iisapp.vbs, if you and I, as well as the VBS default associated program, then you need to manually to the directory, choose to open the way, and then select " Microsoft (R) Windows Based Script Host to perform, you can get a corresponding relationship between the PID and the application pool. )
3, to IIS to see the application pool of the Web site, OK, to make the above memory or CPU restrictions, or check the program has no dead loop and so on.



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.