How to solve w3wp CPU and memory usage problems (1)

Source: Internet
Author: User

In Windows IIS6, w3wp memory usage often fails to be released in time, resulting in slow server response.

Actual Case

Server Configuration
Xeon 2.8G
Memory 512 MB
Two SCSI hard drive soft images)
Windows 2003

Now a website developed by asp.net is suspended, with a low access volume but a problem. The problem is that every two or three days after the server runs, the Website access is very slow, and it will be normal after the server is restarted.

The memory usage of the Failover process shows that the w3wp.exeand sqlservr.exe processes occupy a considerable amount of memory of more than 170 MB. The physical available memory is almost used up, and the memory occupied during server restart is only 40 MB ), in the past, websites were mounted on a virtual machine, and databases were separated. This was never the case.

Later, this problem occurs when the original version is transplanted to the new server.

Another problem is that you can view the SQL process in the SQL Enterprise Manager and find that many of the processes caused by. net are sleeping, but they occupy the memory and cannot be released.

Measures taken:

IIS service manager ---- application pool ---- add your application and set the maximum memory. When the Program reaches the maximum memory, it will automatically restart.

Upgrade the memory to 2 GB, And the access traffic is relatively high. Generally, it takes about 24 hours to restart. The memory is not used up, and the W3WP process accounts for one hundred and eight 90 MB, when SQL accounts for more than two hundred logs, it must be restarted. Otherwise, the entire site will be down.

Solution 1:

W3wp.exe is your ASP. NET application host. If you use a large number of Session, Cache, and other resources, and the Session supermarket takes a long time, the memory usage is relatively large. The application pool is a feature designed to increase performance, but it also consumes a lot of memory. In addition, you can disable most services in Windows Server 2003 without having to do so. This can also save some memory usage.

1. Suspect the CACHE applied in the program,
2. the CACHE contains a large amount of data.
3. Frequent CACHE refresh
4. No CACHE method is designed.

Solution 2:

Trace the SQL call records and record the time each time a large amount of data is written to the CACHE or SESSION to check whether the time is too frequent.

1.The process of asp.netin win2003is w3wp.exe

M memory is enough for personal use, but it is not enough to put it on the server, especially win2003 asp.net SQL server. In particular, SQL server is very memory-consuming. If it is not controlled, it will occupy only a few dozen MB of physical memory and 100 MB of memory ). Win2003 occupies around MB. There is nothing left.

3. to optimize the asp.net program, I would like to say that there is little or no need to use session cache applications and other things, and whether there is a page flip, the page flip processing will also occupy a lot of memory.

4. Restrict SQL Memory. Enterprise Manager -- SQL attributes are generally local) -- "Memory" tag. Here we will look at the memory settings and change the maximum value to 100 MB.


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.