Determine the CPU and memory usage of w3wp.exe

Source: Internet
Author: User

In Windows + IIS6, w3wp memory usage often fails to be released in time, resulting in slow server response.
After studying it today, you can make the following configurations:
1. Separate applications for each website in IISProgramPool configuration. 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. Then, when the memory or CPU usage exceeds the limit, the memory will be automatically reclaimed.

In general, this can be solved. 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 PID with the highest memory usage or CPU usage.
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, we can see the application pool corresponding to the PID.
3. Check the website corresponding to the application pool in IIS.

Q: My situation is as follows:
2 Xeon 2.8 GB memory 512 m scsi hard disks (soft images) configured on the server)
Windows 2003
Now I am stuck with an Asp.net website with a low access volume, but one problem is that
Every time the server runs for 2-3 days, it is very slow to visit the website. After restarting the server, it will be normal.
View the memory usage of the process and find that the w3wp.exe and sqlservr.exe processes occupy the memory.
The size of physical available memory reaches more than 170 MB (each), and almost no memory is used up.
(The memory occupied during server restart is very small, only 40 MB per)
In the past, when a website was mounted to a virtual machine, databases were separated. This never happened.
Later, the original version was transplanted to the new server ~~
Another problem is that I found many SQL processes in the SQL Enterprise Manager. The process caused by. NET is sleeping, but the memory is occupied ~ Cannot be released

I haven't solved this problem for a long time.
For help ~~ Please kindly advise ~~ Thank you very much ~~~~~

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

My problem is the same as yours, but my memory is 2 GB and the access traffic is high. Generally, I have to restart after 24 hours of operation, and the memory is not enough, w3wp processes account for one hundred and eight 90 MB, and SQL accounts for more than two hundred MB, You have to restart, or the whole site will be there .... 55555555. It's almost half a month. It's still not good. It's painful.

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, turning off most services in Windows Server 2003 (which can be switched off without any need) can also save some memory

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.

I have met your problem before. I used to use sessions. After I changed them all to cook, it would be much better, it should be because of a problem with your session or your cache (the cache doesn't know much about it, but it should be somewhat true)

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

MB 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 all the physical memory (only a few MB is left for 100 MB ). 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 (generally local) -- "Memory" tag
Here, let's look at the memory settings and change the maximum value to MB.

Article 4 is the fastest way. You can try it.

This problem also exists in one of my self-developed OA systems.
To sum up, this is probably because of the improper use of sessions and cache.
Many sessions and caches are used in my application,
I found the "dynamic memory allocation" article in msdn. Today, I will explain whether it works.
I hope some experienced friends can give me more information. You can also summarize the reasons for similar errors. Thank you !!

I don't know what website you are. It is said that it will not occupy such a large amount. As shown above, you have used the cache to store excess content. Of course. Session-like objects are unlikely to occupy such a large amount of data, or some objects with a long time or permanent persistence similar to the application are used to save a large amount of data. For example, using a single instance to save data may result in a large amount of memory.

Jianye 2003 system installation requires at least 1 GB of memory.

W3wp.exe is an IIS process in 2003. As for the memory usage of SQL statements, it may be because your SQL statements do not set a memory usage limit.

In iis6, the memory and CPU usage of w3wp.exe cannot be released in time, resulting in slow server response.

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.

Solve the problem of 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.

The app pool is obtained based on w3wp:
1. Add the PID field to the task manager. You can see the process PID with the highest memory usage or CPU usage.
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: \ windows \ system32 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.

-

Reference: http://www.knowsky.com/343457.html

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.