sarsnake
sarsnake

Reputation: 27713

Speeding up a Web Service

I have a web service running and I consume it from my desk application that is written on Compact Framework.

It takes 13 seconds to retrieve 8 results which is kinda slow. I also expect to be retrieving more results in the future. The database query runs fast.

Two questions: how do I detect where the speed slow down occurs? Do I put timers in the Web services code?

I would like to detect whether it is the network or the application code. This is my first exposure to web services in a real environment so please bear with me.

i used asp.net 2.0 and c# to write a simple web service.

Upvotes: 1

Views: 1941

Answers (5)

Ty.
Ty.

Reputation: 3948

Two biggest pain points are going to be instantiating the web service reference and transferring all the data over the network. Pending anything turning up where some obvious blunder was made, I would look at ways of reducing the size of your xml and ways of better handling your web service reference.

All I know about the compact framework is that it is a pain to work in. I've worked on a number of web projects though and profiling your server, putting in logging to record the time taken will be helpful. If all the time is being taking post server response, however, it won't do much more than prove your server is working quickly.

SoapUI is a fantastic java application for consuming web services. It has a lot of functionality, including time metrics. I would start with that and see how long it takes to consume the same thing your client would be. Failing issues there, start with what I recommended above.

Upvotes: 0

Chris Brandsma
Chris Brandsma

Reputation: 11736

Another good profiler is the EQATEC Profiler. I did a write up on it here: http://elegantcode.com/2009/07/02/eqatec-profiler-and-net-cf-profiling-and-regular-net/

And it works find for .net CF projects. But this will allow you to see if there performance issues in unexpected places.

Upvotes: 2

Thiyagaraj
Thiyagaraj

Reputation: 3685

The database connectivity from your service to the DB could be a possible cause for slowdown. Adding timers should do the trick. If the code isnt too huge, you can look at the coding constructs to come up with an informed decision of where exactly things can be slow. Then add the timers. You would get a fair idea of where things are slowing down.

Upvotes: 0

user170328
user170328

Reputation:

A starting point is to profile your web service to see where the delay is comming from

Did you know the CLR Profiler? There are some tools you can use to see what is happening

http://msdn.microsoft.com/en-us/library/ms998579.aspx

Upvotes: 0

Jay
Jay

Reputation: 5043

Your already on the right track of adding event logging, and include timers in them. Note, doing so will add to the over all time it takes, so you'll want to remove them after you track down the culprit. Also look into running the same webservice call multiple-times without re-initiating the connection, that may be cause as well.

-Jay

Upvotes: 0

Related Questions