IIS Randomly Hanging

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.
 
M

Mark Rae [MVP]

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.
 
M

Mr. Arnold

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.
 
M

mgdev

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.
 
M

Mr. Arnold

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
 
M

Mark Rae [MVP]

[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...
 
M

mgdev

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?
 
M

Mark Rae [MVP]

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...
 
M

Mr. Arnold

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.
 
M

Mark Rae [MVP]

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...
 
M

Mr. Arnold

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.
 
R

Raghupathi K

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.

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top