0

it might be a bit off topic but i am looking for some rules how to optimize the speed of a web service. At the moment i am getting a response time of 12 to 18 seconds. The web service connected to 1 database but gets data from 3 different tables. I noticed that if i connect to 1 table my speed is about 2 seconds to get all the data.

Is there some documentation available that can help me on my way to optimize perhaps the web service (or even the database) to gain most of it's speed?

Some questions in this case:

  1. connecting to multiple tables makes a web service slow?
  2. if so, would it be better to cut up the web service and connect to each table separately (testing showed me that it took 5 seconds in total)?
  3. is there another way (instead of point 2) to speed all up this would mean for me also redesigning the code that handles the response of the WS and will set me back a few days in development.

thanks

Ewald Bos
  • 1,560
  • 1
  • 20
  • 33
  • 2
    is your code asynchronous? if not, pulling data from three separate tables will be ~3 times slower than pulling from one - google 'async await' – Neil Thompson Sep 08 '15 at 09:02
  • possible duplicate of [How to achieve high-performance REST API on Azure with .NET?](http://stackoverflow.com/questions/7571784/how-to-achieve-high-performance-rest-api-on-azure-with-net) –  Sep 08 '15 at 19:14
  • Thanks @NeilThompson i added the async await code but it still seems slow, kinda new to ws – Ewald Bos Oct 29 '15 at 09:25

1 Answers1

1

You need a way to identify the bottleneck. As you're hosting on Azure, you can try Glipse: (at http://getglimpse.com )

A tip:

-run your queries against your database and enable a profiler / execution plan to check if there's a missing index. Try to write your query in a different way and compare the execution plan to see if there's any improvement.

Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90