Reputation: 6676
We have notice a huge performance impact on our asp.net mvc application since we moved to azure web apps. One thing we've noticed is that request times slow down significantly when an action is loaded the first time in a couple hours. Our app is not used a lot so there's a lot of idle time. I'll give a few examples (please note these are just back-end request response times, and exclude dom, js, image, etc. load times):
I realize that some of the speed up might be due to query caching, but I am wondering if that's all. I am on a standard plan and do have "Always On" enabled, so I know that's not the issue. And this seems to be happening per action. So even if the user visited action1 already and now visits action2 for the first time, they'll still experience slowness.
What can I look for here to fix? Are there any azure specific settings?
Upvotes: 1
Views: 1502
Reputation: 27793
One thing we've noticed is that request times slow down significantly when an action is loaded the first time in a couple hours.
As you did, enabling “Always On” setting on Azure web app can increase application responsiveness, especially if application is not very frequently accessed by users.
these are just back-end request response times, and exclude dom, js, image, etc. load times
Please check the code logic of those actions and make sure the code is efficient. Besides, you can try to specify custom initialization/warm-up actions for those pages (that always take long response time when the first time client browse the page). If possible, you can cache the frequently used data instead of retrieving data from database (or other sources) every time client browse the web page.
<system.webServer>
<applicationInitialization doAppInitAfterRestart="true">
<add initializationPage="/Home/Contact" hostName="appname.azurewebsites.net" />
</applicationInitialization>
</system.webServer>
Upvotes: 2
Reputation: 15608
Please run your query as shown below:
`--your query goes here
go
select * from sys.dm_exec_session_wait_stats where session_id = @@spid order by wait_time_ms desc `
The last SELECT statement will provide us the cause it takes so much time to run the first time.
It could be poor IO performance on large queries running on lower tiers.
Hope this helps.
Upvotes: 2