1

I am trying to make a call to my web api using Refit in a Xamarin Forms app and it seems to work well in the emulator (2 - 5 secs) but crashes most times on a real android phone or takes quite long to return on rare occasions. I am using a basic 5 DTU SQL database on Azure. Could this be the reason

enter image description here

I have tried to make 2 calls from the device and the spike in the chart above is a result of it. The first query takes a bit of time and once it returns (I managed to get a reply this time) I make a second call which returns too after a delay. Do I need to use indices at all..??

Performance Overview - SQL Database

tribal
  • 219
  • 3
  • 14
  • Can you share what the load on your database is? Are you getting adequate throughput on the phone to handle the data you're attempting to query? I am unfamiliar with the delay that a mobile network could introduce into a connection to your database. – Dan Rediske Jan 14 '17 at 00:53

1 Answers1

0

I am using a basic 5 DTU SQL database on Azure. Could this be the reason

Yes- it is entirely possible that your issues will be resolved by changing your tier of Database; the graph shows that your query hits a lot of that 5DTU limit. If your query is complex or your dataset is sizable, you may get better performance out of an S-tier database. (Try an S0 or an S1 and check if you see better performance.)

Do I need to use indices at all..??

Depending on the type of queries you are running, an index may have a beneficial impact on the performance of your database. (You definitely ought to investigate whether you can optimize performance this way.) You might be interested in some of the features of Azure SQL Database that can help you examine (and improve) query performance-SQL Database Advisor &SQL Query Store.

Dan Rediske
  • 852
  • 4
  • 14
  • Thanks for the reply Dan, I am using EF code first and not sure if that is the cause however that still does not explain why its performing well on the Visual Studio emulator for Android. Could it be some kind of an authentication issue. Do I need to change any settings when trying to expose Web API for mobile apps – tribal Jan 28 '17 at 17:55
  • Your issue could be that your testing may spin up a local test database which could be much more than 5dtu. Are you sure that you're testing against the same database? – Dan Rediske Jan 28 '17 at 18:37