Profiling WCF application

We are currently developing an enterprise HRMS application. The end users see a web application that calls the middle tier through WCF. This Middle Tier has several functional modules (eg. Benefits, Payroll, Administration, Common, HRMS, etc). Code related to each of these modules is bundled into separate components (eg. Emportal.EEA.Facade.Direct.BenefitsAdministration.dll) .

- The web application calls methods in the middle tier through proxy dlls (WCF)
- The middle tier is not hosted on IIS. Below is the config file that shows how the service is hosted and exposed to the outside world.

<service name="Emportal.EEA.Facade.Direct.BenefitsAdministration.BenefitsAdministrationListFacade" behaviorConfiguration="metadataSupport">
<host>
<baseAddresses>
<add baseAddress="net.[url=tcp://localhost:8311/BenefitsAdministrationListFacadeService]tcp://localhost:8311/BenefitsAdministra ... adeService[/url]" />
</baseAddresses>
</host>
<endpoint address="BenefitsAdministrationListFacade" bindingConfiguration="TCP_Windows" binding="netTcpBinding" contract="Emportal.EEA.Facade.Interfaces.IBenefitsAdministrationListFacade" /> </service>


Ideally I would like to profile the code in one or more of the modules (Emportal.EEA.Facade.Direct.BenefitsAdministration.dll) at any given time. I am not sure how to point the profiler wizard to the code.

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi,

    Sorry, but I don't think anyone can help unless we know what process is actually hosting the middle tier. More than likely, it sounds like it could be a Windows Service, since your webservices are doing something altogether different and a desktop application would usually require a console session for a user to start it.
  • Actually there is a console application, FacadeHost.exe, that is facilitating communication between the web app and the middle tier components. However, I am not sure whether profiling this console app will enable me to profile code in the components. Does this answer your question?
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Profiling FacadeHost.exe as a desktop application will pick up any WCF calls made inside that process. That sounds like the way to go to me.
  • Brian:

    The question is whether profiling FacadeHost.exe will profile code in the components where most of the middle tier code is.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi,

    I'm afraid I don't know enough about the application to answer that.
  • Hi

    I'm in the same situation. We have a lot of WCF services running via a ConsoleHost.exe (eventually they will run as Windows Services).

    I've tried ants for about a week.
    Ants can profile the WCF services, however I haven't managed to profile the second WCF call. I have a service that calls another service and I don't know how to profile the methods in the second one.

    Does anyone have an idea to solve this?

    /Michael
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi,

    If I understand correctly, what you want to do is profile an WCF client and server in an end-to-end way. ANTS Profiler can only do each process separately, so you couldn't profile the client and the server in the same profiling session.
  • Hi, Brian

    Thats not what I meant. Actually I was wrong in my previous post. Sorry about that.
    I'll try to explain our situation in more detail.

    In my development team we're using an application (ConsoleHost.exe) which starts some WCF services for the system (the ConsoleHost.exe is our server app). The ConsoleHost.exe also starts a timer (not WCF) which calls some methods on the WCF services every minute or so.

    The problem is that the WCF calls from the timer is not profiled. The only thing I get is the total time for the call.
    I would want to profile the code in the WCF services as well not only the code in the timer.

    I hope that this is more understandable.

    Thanks for your reply.

    /Michael
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I'm still not sure. Do you mean you're not seeing the WCF methods in the line-level timings?
  • I got it working now. Had to do some minor changes to the code to make the methods show up in ants.

    Thanks for your fast replies.

    /Michael
  • Hi,

    Picking up thread from colleague forrest/Michael. We've been profiling our WCF-services in a number of ways and are struggeling with how to interpret results.

    Initially we had Ants launch NUnit external GUI and ran our system tests. In the tests, we start the services from within NUnit. Thereby they are in the same process as NUnit and we get a profiling result from WCF-proxy down to datalayer. However, the results were quite shocking - the WCF overhead was huge. I.e. the call on the WCF-proxy was 5-10 times longer than the actual delay for the underlying methods, where we'd expected the DB-call to be the bottleneck.

    We've tried the MS dual core hot-fix, but with no improvement.

    Then we profiled a client which was calling the same interface, of a manually started host, and the result was quite different - the WCF overhead was reasonable. But when we had the client start the services in the same way as the tests, we got the overhead back. Code was running significantly slower, and Ants did not compensate accurately.

    We've also profiled by plain old tracing to confirm that we don't have this overhead in reality.

    Best regards

    /Jonas Karlsson
Sign In or Register to comment.