Re: w3wp.exe 100% CPU

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



IIS6 has several features to help with this situation.

First thing you want to do is isolate your dev environment from the
production environment. This is best done using Application Pools. Create
and use a custom Application Pool when developing your code, and let the
rest run as production.

This allows you to do the following when you screw up code that runs in
w3wp.exe -- you can now RECYCLE the custom Application Pool running your dev
code WITHOUT affecting production code running in the other Application
Pools. The recycle will kill all the misbehaving w3wp.exe of the recycled
Application Pool.

Thus, if the w3wp.exe running your dev code has an infinite loop, just
recycle your dev App Pool and things should go back to normal.

If you do not want to manually recycle, you can configure additional
CPU-monitoring health metric on the dev Application Pool to automatically
recycle the application pool after it has reached a certain CPU% over a
configurable period of time. In other words, it is possible for you to tell
IIS to automatically recycle your dev application pool if it has been 100%
CPU for one minute -- so you can just keep working and IIS6 will just
recycle automatically.

There are many other health-monitoring metrics on IIS6 that do similar
behavior, and you can experiment and take advantage of all of them on your
dev Application Pool.

The key is to first isolate your potentially badly-misbehaving dev
application in its own Application Pool. Then, you can put many IIS6
features to work for you.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Jacky via DotNetMonster.com" <forum@xxxxxxxxxxxxxxxxx> wrote in message
news:53E37ADE4B0E5@xxxxxxxxxxxxxxxxxxxx
hi everyone,
I'm developing my website with asp with IIS and 2003 server. Today when I
did some test after editing my asp script, my browser just took forever to
load the page. Then I manually closed my browser and reopen it again for
testing. But the same thing happened again after a few more tests, for
which
it ended up my whole site was not responding. I found out that w3wp.exe
process took up 100% CPU usage that's why my whole site is not responding,
for which I have to restart my MSSQL server in order to work again.

I've searched around the Internet, and found out the possbile cause is my
inappropriated asp code, which leads the system runs into an infinite loop.

Now my question is I'm constantly changing my code, doing testing and
debugging all the times, so same thing may happen again (infinite loop)! If
I don't close my browser manually, and let it run until it times out, will
that free up the w3wp.exe and resume the site back to normal? Because I
don't want to restart my MSSQL server every time I have this problem cause
it
will affect my clients at my website.

Please help me on this! Thanks alot!!!


.