When a web server is used, it is often found that the memory and CPU usage of w3wp.exe cannot be released in time, which leads to slow server response speed. Sometimes the server even crashes and has no response. Let's talk about the memory usage of w3wp.exe.
Solution to w3wp.exe CPU usage of 100%
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.
Figure 1: Create an application pool
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.
Figure 2: Set CPU
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.
Figure 3: Selected PID (process identifier)
2. Run iisapp 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 Windows Based Script Host 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.