Red Gate forums :: View topic - How do you profile a WCF service in IIS 7?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Performance Profiler 6
ANTS Performance Profiler 6 forum

How do you profile a WCF service in IIS 7?

Search in ANTS Performance Profiler 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
RazorKramer



Joined: 23 Feb 2011
Posts: 4

PostPosted: Wed Feb 23, 2011 8:46 am    Post subject: How do you profile a WCF service in IIS 7? Reply with quote

When I attempt to profile a WCF service in IIS 7, I only get system level methods in the trace window. Why don't I see my custom code getting called?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Wed Feb 23, 2011 2:33 pm    Post subject: Reply with quote

Are you actually invoking the WCF service using whatever client you normally use? Profiler can't profile code that hasn't been run.

Additionally the profiling settings are really confusing. Basically you have to remember to reconfigure your client contract to use the TCP port you specified in ANTS Profiler's unused port setting or your client will be hitting the other copy of the website that is still hosted in IIS rather than the one hosted by Profiler.

Gets you every time.
Back to top
View user's profile Send private message
RazorKramer



Joined: 23 Feb 2011
Posts: 4

PostPosted: Wed Feb 23, 2011 3:49 pm    Post subject: Reply with quote

Yeah, I believe I'm doing everything right. I have even shutdown the IIS application pool, tried to call it and as expected I got a "service point is not listening" type of error. Then I fired up ANTS using the original port and I was able to call the service. So I think I have all that correct?

Now when I call the service method in my WCF service which calls another class method that performs a Thread.Sleep for 4 seconds, I only see the System type of methods listed in the Method window. I would expect at this point to see my service class method and the other class method that contains the sleeper method to be listed, would that be an accurate assumption?

Another thing to note is when I call the service for the first time since starting ANTS, I do see a spike in the ANTS Processor Time graph which lists System methods and one thing of particular interest is a note entry within the Method window stating "Transition to managed code...". What the heck does that mean? Is that where I should see my managed code? I do have Profile Child Processes checked.

The other thing I'm a bit fuzzy on... if I was to have a web service at the following location http://localhost/MyWcfService/MyTestService.svc, do I provide http://localhost/MyWcfService/MyTestService.svc or http://localhost/MyWcfService in the application URL un the Application Settings?

I'm evaluating the product and not having the ability to affectively profile a web service is a deal breaker.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Wed Feb 23, 2011 4:27 pm    Post subject: Reply with quote

Can you try shutting down IIS and then see if your WCF consumer still functions properly? If not, your calls are going to the WCF svc hosted in IIS. This would explain why it appears to work and you see none of your methods in the results.
Back to top
View user's profile Send private message
RazorKramer



Joined: 23 Feb 2011
Posts: 4

PostPosted: Wed Feb 23, 2011 6:00 pm    Post subject: Reply with quote

I shutdown IIS and tested w/out ANTS and I get a service endpoint is not listening type of error. I start ANTS and I can call the service successfully.

ANTS is on CPU Time and all I have is System type of methods in the Method window. What does draw my attention is that there is an entry labeled "Transition to managed code..." which feels like that is where the details are that I'm looking for. The problem is that message is very static and I can't expand it or nothing.

Any ideas?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Wed Feb 23, 2011 6:08 pm    Post subject: Reply with quote

Hi,

There are a few things in the tree view that have no detail like "thread blocked" and "transition to managed code". This is not related to the problem.

Can you try turning all filters off? Ie: "hide insignificant methods" off, show "all threads" and "all methods" rather than "methods with source code".
Back to top
View user's profile Send private message
RazorKramer



Joined: 23 Feb 2011
Posts: 4

PostPosted: Wed Feb 23, 2011 6:54 pm    Post subject: Reply with quote

I have and still nothing.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Thu Feb 24, 2011 10:52 am    Post subject: Reply with quote

Does the status of Profiler (lower-left) say "profiling..." the whole time? Maybe your web app is crashing. It's the most common problem with Profiler at the moment.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group