profiling .NET 3.0 WCF
herbert.lacay
Posts: 4
i'm evaluating ANTS Profiler 3.0...
I was profiling for performance measures on my web application which is using web services (WCF).
Here what I was trying to do:
1- I create a WCF service, with a function that queries from a SQL database.
2- I create a web application, wherein the web application consumes the WCF service.
3- from the web application, I call the function from the WCF service to be able to return the data from the service.
4- I render it on the browser
What I’m trying to do here, is if I can trace the performance profile from the web application, which invokes the service until the data is renders… so I may be able to see where the bottlenecks are...
can i do this w/ ANTS?
I was profiling for performance measures on my web application which is using web services (WCF).
Here what I was trying to do:
1- I create a WCF service, with a function that queries from a SQL database.
2- I create a web application, wherein the web application consumes the WCF service.
3- from the web application, I call the function from the WCF service to be able to return the data from the service.
4- I render it on the browser
What I’m trying to do here, is if I can trace the performance profile from the web application, which invokes the service until the data is renders… so I may be able to see where the bottlenecks are...
can i do this w/ ANTS?
Comments
Yes, this should be absolutely fine.
There's one slight caveat, which is that you can only profile either the web application or the WCF server at any one time (assuming they're hosted on different sites).
Rob
Red Gate
i have tried the steps i stated, however... the profiling data i get is on the web application only... they do not contain any details/profiling data inside the wcf service.
also, i tried to profile directly on the .svc and i still have no result...
do you by any chance have any docs detailing how to profile an .svc service?
thanks,
Herbert
How are you hosting the WCF service? In IIS, the ASP.NET development web server, or in a standalone application?
If IIS, what version of IIS?
If you want to profile the WCF server code, you'll need to profile the site or application hosting that.
Now, if you're on IIS 6 or IIS7, you might notice that the port we start profiling on by default is different to the one the site normally resides on (to avoid having to stop the "real" site). This means that you'll also need to point your client at that new port if you want to profile the calls being made. On IIS 7, you can disable this option, and chose to profile on the original port.
I don't believe we have any documentation that specifically deals with WCF - I'll pass this on as a suggestion for future improvement.
Thanks,
Robert
Red Gate
How are you hosting the WCF service? In IIS, the ASP.NET development web server, or in a standalone application?
[herbert.lacay] i running my profiling primarily on ASP.NET development web server, however i may need to move to ISS...
If IIS, what version of IIS?
[herbert.lacay] my IIS is 6.0, but as mentioned; my primary profiling is on asp.net development server.
This means that you'll also need to point your client at that new port if you want to profile the calls being made.
[herbert.lacay] is this in reference to the web app that is consuming the wcf service? or the wcf service itself?
can you provide me w/ your steps as to how you did profiling per my first post?
thanks
If you're hosting the server in WebDev, then you should be able to select the .svc file in ANTS Profiler when you start profiling. You can also select the port to use - if you don't already have WebDev running, you should be able to select the original port, though of course this will need to be free in order to do so.
Once you've got ANTS Profiler profiling the server, you should then start using the client application (outside of the profiler). This will make calls to the server (being profiled), and you should see the results appropriately.
The important thing here is to be careful about the port numbers. For example, if your server is currently being hosted on port 80, your client app will also be looking at port 80 when it makes requests.
If you then start profiling, choosing to host the server on port 8013, but don't change the client, it'll still be making requests to port 80. This will either fail (if you closed the original server that was running on port 80), or bypass the profiler entirely (if you left the original server running). Either way, you won't get results!
In this situation, either change the port in the ANTS Profiler wizard to use the port the client expects, or change the client to use the port that ANTS will use.
I hope that makes sense,
Robert
Red Gate