BHUVANESH MOHANKUMAR
BHUVANESH MOHANKUMAR

Reputation: 2777

Azure environment respond very late for few seconds after deployment

When the MVC application is deployed to azure environment, there is slowness in page loading and also response time of web site get delayed for few seconds once the deployment is done.

When the application is deployed in production environment, this slowness make the bad user experience.

Automation test scripts fails due to delay in response of site immediate after deployment

Deployment is done from Visual studio 2013 to Azure Web App services using Visual Studio Publish option settings.

What we have tried: Deployment is scheduled once in 30 days and also in mid night, however the user in other part of world face issues when deployment happens.

Can some one help me to resolve issue and there should not be any difference to user when deployment happens in production.

Upvotes: 0

Views: 223

Answers (1)

kim
kim

Reputation: 3421

There is a slight increase in loading time, for the first request, after an application is deployed to an Azure Web App. What happens behind the scenes is that the underlying web application must pre-compile the MSIL into machine code before it can serve the site. See https://msdn.microsoft.com/en-us/library/ms366723.aspx for more details.

The application pool, used by the Web App, is also regularly recycled in case of in-activity. The same pre-compilation happens then as well. This downtime can be minimized by enabling "Always-On" for the Web App. See https://azure.microsoft.com/en-us/documentation/articles/web-sites-configure/ for more details on how to enable it. The always-on feature regularly pings the site to keep it from going inactive.

Also, to minimize downtime, when doing a deployment to a Azure Web App. Have a look at using deployment slots, https://azure.microsoft.com/en-us/documentation/articles/web-sites-staged-publishing/. Idea here is that you first deploy to the deployment slot (an own web app instead, get it warmed up) and swap it to be the production slot. This way achieving minimal downtime for the Web App. To automatize this process there is a feature called Auto Swap https://azure.microsoft.com/en-us/documentation/articles/web-sites-staged-publishing/#configure-auto-swap-for-your-web-app that does this for you.

Deployment slots are available for standard and premium apps while always-on is available for basic, standard and premium apps.

Upvotes: 2

Related Questions