IIS Randomly Hanging

  • Thread starter Thread starter mgdev
  • Start date Start date
M

mgdev

I need some help on how to troubleshoot IIS Randomly Hanging on my server.

Late last year we upgraded our ASP.net (2.0) application with a lot of new
features. Now that we've rolled this new version out to many of our
customers we're getting complaints about IIS hanging and needing to be
restarted. Unfortunately, this hanging is random. After the restart of IIS
the application works as expected. We are unable to predictably reproduce
this hanging situation. But at some point, anywhere from an hour to a few
days, the w3wp.exe will hang again and prevent the system from being used. I
have observed this first hand, but as I stated above, after restarting IIS I
can't reproduce the problem.

We have seen this problem in both IIS6 (Server 2003) and IIS7 (Server 2008).

If you have any suggestions on how I can go about troubleshooting or
resolving this issue I'd like to know. Please know that this is an urgent
matter so if there are any options I can try that would minimize this problem
for the short term I'd like to explore that as well.
 
We have seen this problem in both IIS6 (Server 2003) and IIS7 (Server
2008).

Which indicates that the problem lies with your app and not IIS per se.

In my experience, the problems that you're facing are almost always due to
memory leaks.

Check that you are disposing objects correctly - do not under any
circumstances leave them around for the garbage collector to handle. This is
especially true for any unmanaged objects and ADO.NET objects. One simple
thing to check is that you are not persisting ADO.NET objects across pages
or <shudders> in Session.
 
mgdev said:
I need some help on how to troubleshoot IIS Randomly Hanging on my server.

Late last year we upgraded our ASP.net (2.0) application with a lot of new
features. Now that we've rolled this new version out to many of our
customers we're getting complaints about IIS hanging and needing to be
restarted. Unfortunately, this hanging is random. After the restart of IIS
the application works as expected. We are unable to predictably reproduce
this hanging situation. But at some point, anywhere from an hour to a few
days, the w3wp.exe will hang again and prevent the system from being used. I
have observed this first hand, but as I stated above, after restarting IIS I
can't reproduce the problem.

We have seen this problem in both IIS6 (Server 2003) and IIS7 (Server 2008).

If you have any suggestions on how I can go about troubleshooting or
resolving this issue I'd like to know. Please know that this is an urgent
matter so if there are any options I can try that would minimize this problem
for the short term I'd like to explore that as well.

You have memory issues, particularly if everything is inproc, and you
have poorly written programs. Memory is being choked, and it's IISreset.
I have seen sites do IISresets as the norm 5 times a day, to prevent the
hangs.
 
In general, we do practice disposing of objects. But I'm sure we are not
perfect and there could be some left behind. Assuming this is a lack of
disposing of objects. Are there any tools that could help me find these
objects? The reason I'm asking is, this application is very large (100+
classes plus 100+ aspx pages) and will take a lot of time to go through line
by line to find indisposed objects.

Please let me know your thoughts.
 
mgdev said:
In general, we do practice disposing of objects. But I'm sure we are not
perfect and there could be some left behind. Assuming this is a lack of
disposing of objects. Are there any tools that could help me find these
objects? The reason I'm asking is, this application is very large (100+
classes plus 100+ aspx pages) and will take a lot of time to go through line
by line to find indisposed objects.

Please let me know your thoughts.

If the w3wp.exe is not given a chance to recycle itself and is
constantly running because the server is too busy running applications,
then static and dynamic memory are going to held onto, and root
variables/objects are not released and memory usage grows.

Also Inetinfo.exe, and Dllhost.exe are IIS processes too that can also
cause memory usage issues too.

http://support.microsoft.com/kb/919790
 
[please don't top-post]

In general, we do practice disposing of objects.

I'm afraid that's not good enough, and almost certainly your problem.

You need to dispose of *ALL* objects every time all of the time.

I would suggest you investigate the database connectivity first...
 
Are there any tools that can help me identify what objects are not being
disposed? Or do I need to go line by line through the hundreds of pages to
find them?
 
Are there any tools that can help me identify what objects are not being
disposed?

None that are worth using, IMO...

Or do I need to go line by line through the hundreds of pages to find
them?

Pretty much.

As I mentioned, I'd start with your database connectivity first.

Luckily this is a small web app (100 classes and 100 aspx pages is tiny in
the general scheme of things), so it shouldn't take you too long...
 
Mark Rae said:
None that are worth using, IMO...



Pretty much.

As I mentioned, I'd start with your database connectivity first.

Luckily this is a small web app (100 classes and 100 aspx pages is tiny in
the general scheme of things), so it shouldn't take you too long...

That also depends on what else is running on the machine that w3pc.exe is
servicing, which can tip it. We face that problem on the IIS server, because
of the client insists upon running this one application that forces
scheduled IIS Resets. They are too cheap to get a dedicated Web server to
run this application.
 
That also depends on what else is running on the machine that w3pc.exe is
servicing, which can tip it. We face that problem on the IIS server,
because of the client insists upon running this one application that
forces scheduled IIS Resets. They are too cheap to get a dedicated Web
server to run this application.

Ah, well yes, at that level, all bets are off and there's very little you
can do about it...

It's the old adage: you can have it good, cheap or fast - pick any two...
 
Mark said:
Ah, well yes, at that level, all bets are off and there's very little
you can do about it...

It's the old adage: you can have it good, cheap or fast - pick any two...

It's the USAF we're talking Web servers on a farm, and all the front-end
Web servers are being IIS Reset on a scheduled bases, because everything
is inproc. The USAF has money, but they will not back completely what is
being used by all the US Armed Forces. -:)

They were finally convinced recently to get a fail-over SQL server. It
is ridiculous.
 
I need some help on how to troubleshoot IIS Randomly Hanging on my server..

Late last year we upgraded our ASP.net (2.0) application with a lot of new
features.  Now that we've rolled this new version out to many of our
customers we're getting complaints about IIS hanging and needing to be
restarted.  Unfortunately, this hanging is random.  After the restartof IIS
the application works as expected.  We are unable to predictably reproduce
this hanging situation.  But at some point, anywhere from an hour to a few
days, the w3wp.exe will hang again and prevent the system from being used..  I
have observed this first hand, but as I stated above, after restarting IIS I
can't reproduce the problem.

We have seen this problem in both IIS6 (Server 2003) and IIS7 (Server 2008).

If you have any suggestions on how I can go about troubleshooting or
resolving this issue I'd like to know.  Please know that this is an urgent
matter so if there are any options I can try that would minimize this problem
for the short term I'd like to explore that as well.

May be this is an issue relating to Application Pool Recylcing/Worker
Process Recycling.

Check out these links, may be useful
http://www.microsoft.com/technet/pr...22e-79a9-4f07-a407-dbd0e7f35432.mspx?mfr=true
http://msdn.microsoft.com/en-us/library/ms525803.aspx
http://www.function1.com/2007/04/turn-off-application-pool-recycling-and-idle-timeout-iis6/
 
Back
Top