We have ASP.Net Core 2.1 Web API hosted in AppService (S1) that talks to Azure SQL DB (S1-20DTUs). Both are in same region. During load testing we found that some API instances are taking too much time to return the result.
We tried to troubleshoot the performance issue and below are our observations.
- API responds within 0.5 secs most of the time.
- API methods are all async methods.
- Sometimes it takes around 50 secs to over a minute.
- CPU & Memory utilization are below 60%
- Database has 20 DTU capacity, out of which 6 DTUs are used during load testing.
- In the below example snapshot from Application Insights, we see total duration of the request was 27.4 secs. But the database dependency duration was just 97ms. There is no activity till the database was called. Please refer below example.
Can someone please help me to understand what was happening in this 27 secs of wait time. What could be the reason for this?