w3wp profiling appears to hang

Code profiling for .NET developers.

Moderator: dom.smith

w3wp profiling appears to hang

Postby jeff.watts@ca.ibm.com » Tue Jan 21, 2014 12:03 am

I am trying to profile our web application by attaching the performance profiler to w3wp.exe process. It works fine for profiling some short web service operation. But when I try to profile a longer running operation our application appears to hang. The profiler shows activity for a period of time as the operation starts. Then the activity drops to 0 (well before it should be completed). Meanwhile our application appears to be blocked or hung.

At this point I can attach to the application using VStudio (so it appears profile is no longer attached).

Running the same service operation without the profile works fine to completion.

Are there any limitations on what can be profiled? I am wondering if its an issue of our application running on multiple threads? Can that cause issues for the profiler?
jeff.watts@ca.ibm.com
 
Posts: 2
Joined: Mon Jan 20, 2014 11:15 pm

Postby Chris.Allen » Wed Jan 22, 2014 2:12 pm

Shooting from the hip, there's two things I know that might explain this.

Firstly, the profiler generates *a lot* of data, is CPU intensive and often has it's wicked way with your code by injecting dynamic IL into it. So, now and again, profiling a long-running process just doesn't work. In such a case, you can either dial down the amount of information gathered (sampling mode is ideal for this) or profile in shorted bursts.

Secondly, we have a known issue that there's a race condition deep in the process that only seems to arise in sampling mode(!).

This is actually quite convenient since- if its failing in sampling mode, try something else; if its failing in the other mode, try sampling :)
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby matt.williams » Fri Jan 24, 2014 10:42 pm

I'm also experiencing the same thing. I launch our web (ASP.NET, C#) project via Visual Studio 2012 and then attach to the w3wp process in ANTS. I'm able to log in and do a few functions before the application and profiler both hang.

Unfortunately, your suggestion re: trying something other than sampling mode isn't possible in 8.4 (Professional) as that option is set by default without the ability to change it.

In order to get around it, I tried attaching it for only certain aspects of the code that I want to profile. However, even then I could only capture 2-3 functions before I have to restart both my dev environment and ANTS.

Is there another way to profile the back end of an ASP.NET website (e.g., access controllers, factories, etc.) other than attaching to the w3wp process? Attempting the other methods results in profiling the front end (e.g., aspx) code.
matt.williams
 
Posts: 1
Joined: Fri Jan 24, 2014 10:27 pm

Postby Chris.Allen » Wed Jan 29, 2014 3:23 pm

I'm not sure why you can't profile using any other mode than sampling in the professional edition as you should be able to use method-level only etc- of course, don't select the option 'Attach to a .net process' use the more direct 'ASP.NET' or 'IIS' profiling option.
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby jeff.watts@ca.ibm.com » Wed Jan 29, 2014 7:46 pm

switching to using IIS profiling (I had been using attach to process) appears to help. It seems to be a little more finicky to get the profile to actually profile what I am doing. And haven't really done a long processing run yet, but it appears to be avoiding the hang now.
jeff.watts@ca.ibm.com
 
Posts: 2
Joined: Mon Jan 20, 2014 11:15 pm


Return to ANTS Performance Profiler 8

Who is online

Users browsing this forum: No registered users and 0 guests