W3wp.exe process occupies too high memory Solution

Source: Internet
Author: User

Worker. This process is used to allocate a large amount of system resources. Now we have studied the following configurations: 1. Configure an independent application pool for each website in IIS. That is, they do not affect each other. 2. Set the recycle time of the application pool. The default value is 1720 hours, which can be modified as needed. At the same time, set the number of w3wp processes that run simultaneously to 1. When the memory or cpu usage exceeds the upper limit, the memory will be automatically recycled. This will solve the problem. However, some websites cannot be correctly released due to program problems. So how can we find the website? 1. Add the pid field to the task manager. You can see the process pid2 with the highest memory usage or cpu usage, and run iisapp-a at the command prompt. Note: the first running will prompt that no js support is available. Click OK. Then run it again. In this way, you can see the application pool corresponding to the pid. 3. Check the website corresponding to the application pool in iis. Recently, the company's servers have a CPU usage of. The server is configured with dual-core Xeon3.0 × 2, and 2 gb ecc memory. W3wp.exe occupies a large amount of CPU for a long time. This should be caused by the endless loop of website programs. Before finding the problem, you can temporarily restrict the CPU usage of w3wp processes to ensure that the website will work: In iis6, the memory and CPU usage of w3wp.exe cannot be released in time, resulting in slow server response. Solve excessive CPU usage: 1. configure a separate application pool for each website in IIS. That is, they do not affect each other. 2. Set the CPU monitoring of the application pool to no more than 25% (4 CPU for the server), refresh every minute, and close when the limit is exceeded. Which application pool is obtained based on w3wp: 1. Add the display pid field in the task manager. The process pid with the highest memory or cpu usage is displayed. 2. Run iisapp-a at the command prompt. Note: the first running will prompt that no js support is available. Click OK. Then run it again. In this way, you can see the application pool corresponding to the pid. (Iisapp is actually a VBS script stored in the C: windowssystem32 directory. Its full name is iisapp. vbs: If you and I are the same, and disable the default Vbs associated program, you need to manually go to this directory, select the open method, and then select "Microsoft (r) run the Windows Based Script Host Command to obtain the correspondence between the PID and the application pool .) 3. Check the website corresponding to the application pool in iis, and then make the above memory or CPU restrictions, or check whether the program has problems such as endless loops. To solve the problem of excessive memory usage, you can configure the following: 1. configure a separate application pool for each website in IIS. That is, they do not affect each other. 2. Set the recycle time of the application pool. The default value is 1720 hours, which can be modified as needed. Then, when the memory usage exceeds 500 mb, the memory is automatically reclaimed. My settings are as follows: first, the CPU limit: After cpu monitoring is enabled, I set the maximum cpu usage of this application pool to 50%. Set the cpu refresh time to 1 minute, and set the operation to "off ". Set the maximum number of worker processes to 1. This means that IIS refresh checks the CPU usage of the independent pool for 1 minute. If the set cpu limit is exceeded by 50%, a command is sent to disable the pool, the pool must be closed within the specified time. If the pool is successfully closed within this time period, IIS will restart a new pool. This period of time is very short. Generally, the pool will not be started any more, people who access the website will not feel it. However, if the pool is not closed for a specified period of time, IIS will forcibly close it and refresh the CPU time. During the stop time, the website cannot be accessed and the message "Service Unavaliable" is displayed ". Set the close time and start time interval: set a shorter time, for example, 10 seconds. In this way, when your website programs occupy a large amount of system resources, IIS automatically recycles the process and starts the process quickly, your website will be ready for work now. Restrictions on memory and process recovery time: I set it to automatically reclaim the memory when the memory usage exceeds mb. There is no limit on the virtual memory. The process recovery time remains unchanged by default. You can set a shorter time as needed. You can also set the maximum virtual memory of the application pool here. If the maximum virtual memory is exceeded, the pool will be recycled.

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.