4

So my server has been going a bit crazy lately, every now and then my IIS thread would eat up 100% of my CPU and hang until I restart it.

I've done a dump and found the culprit ASPX page, however, I do not know how to figure out further from there what's going on.

Obviously I've done something very wrong - so is it possible to see where in the code are the threads running when IIS begins eating up my CPU?

Thanks, Ron

Ron
  • 1,806
  • 3
  • 18
  • 31
  • How did you go about getting this dump? – WEFX Feb 14 '19 at 20:23
  • @WEFX this was asked over 7 years ago; but what I learned to this day is that you need to get a full memory dump (You can create a dump rule or do it manually), then using the exact same build's PDBs I will open the dump in Visual Studio and go over the threads to see which one is the culprit. Every deployment we make we automatically save the PDB files as part of the automated deployment process. – Ron Feb 17 '19 at 14:33

3 Answers3

1

In order to see what code the threads are executing, you will need the symbols (.pdb files) that match the code that was running. You will also need to set up symbols for the .NET Framework/Windows dlls. This KB covers how to do that: http://support.microsoft.com/kb/311503

The WinDbg tool and SOS.dll debugging extension allow you to find the threads that have the highest CPU !runaway, and you can then inspect the stack !clrstack. Tess has a great demo showing how to use this to track down a high CPU thread here: http://blogs.msdn.com/b/tess/archive/2008/02/22/net-debugging-demos-lab-4-high-cpu-hang.aspx

Jared Shaver
  • 1,339
  • 8
  • 12
0

This is usually when you make a close loop - something like.

function int ThisOne(int SomeVar)
{
   return SomeVar+1;
}

function int ThisOne(int ? SomeVar)
{
  // here you try to call the ThisOne(int SomeVar), 
  // but you call him self and crash
  return SomeVar == null ? 0 : ThisOne(SomeVar);
}

Other way to make this error that also make a close loop and crash

public string sMyText
{
   get {return sMyText;}
   set {sMyText = value;}
} 

Similar questions: How do I crash the App Pool?

IIS crashes and restarts without dropping a mini-dump

Community
  • 1
  • 1
Aristos
  • 66,005
  • 16
  • 114
  • 150
  • I know it's caused due to some sort of deadlock, my website is a bit more complex than that snippet. I need a way of finding out where my code live on the machine; if at all possible – Ron Mar 04 '12 at 20:47
0

Recently, I was in the same situation: I wanted to measure what's going on on my live production server.

Having asked the question also in the Red Gate's ANTS Profiler forum, I got a great reply from the developers:

Basically the pointed me to the Early Access Program (EAP) version of version 7 of ANTS Profiler. This one has a feature that they call "continuous profiling" which basically does a live trace of a IIS worker process.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291