We are using Azure webapp to host our app which is a mid-size Asp.net MVC application. the problem is that whenever we publish to that instance it takes so long (about 3min) for the first request to be responded.
I created some logs in Application_Start
to measure when exactly this method is hit and how long does it takes, it showed that it takes ~20s for this method to execute (Ioc Container, AutoMapper,... warmup) but the weird part is the ~120s before Application_Start
is called. I measured this by subtracting the time the first request is sent and the time the first log is created in Application_Start
.
My question is what exactly happens at that time between restarting the webapp, sending the first request and hitting Application_Start
of the webapp? is it related to the size of the app? (our app contains lots of references/subdirectories/...)
We are using P2V2 App Service Plan and two instances.