question

BrianBrinch avatar image
0 Votes"
BrianBrinch asked BrianBrinch commented

Increasing response times when deploying to app service

I have a number of app services running in Azure and I just changed our deployments to use a staging slot for each app service. My flow is like this, using AZ CLI in each step:

  1. Delete existing staging slot

  2. Create new staging slot

  3. Deploy website to staging slot

  4. Warm up staging slot (using Invoke-WebRequest)

  5. Swap staging slot to production


But when step 3, 4 and 5 is executing the site is still running but it's very slow and response time are high. Do you have any idea how to make this more smooth? Can I scale the app service before starting the processes or what can I do?



azure-webapps
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, @BBCDenmark

Slots consume the same App Service plan resources. Check your App Serivce metrics. Do you have enough resources?

1 Vote 1 ·

Thanks a lot @TakahitoIwasa , I really didn't know that and I wonder if I can resize / rescale it on demand before deploying and back again to normal when done. I will try to find out.

Thanks again

0 Votes 0 ·
SnehaAgrawal-MSFT avatar image
1 Vote"
SnehaAgrawal-MSFT answered BrianBrinch commented

Further if the swap operation takes a long time to complete, you can also get information on the swap operation in the activity log. On your app's resource page in the portal, in the left pane, select Activity log. A swap operation appears in the log query as Swap Web App Slots. You can expand it and select one of the sub operations or errors to see the details.

Please refer to below links for more details on this:

https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots#what-happens-during-a-swap

https://ruslany.net/2017/11/most-common-deployment-slot-swap-failures-and-how-to-fix-them/

https://ruslany.net/2019/06/azure-app-service-deployment-slots-tips-and-tricks/

Let us know if issue remains.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for reaching out and sharing the links. I will check them out. I solved it by scaling up before swapping and scaling down again after.

0 Votes 0 ·
SnehaAgrawal-MSFT avatar image
1 Vote"
SnehaAgrawal-MSFT answered

Just checking if you are still facing this issue.

Adding some information here regarding Azure App service deployment slot swap might be helpful:

Some apps might require custom warm-up actions before the swap. The applicationInitialization configuration element in web.config lets you specify custom initialization actions. The swap operation waits for this custom warm-up to finish before swapping with the target slot.

During the swap operation the Web App’s worker process may get restarted in order for some settings to take effect. Even though the swap does not proceed until the restarted worker process comes back online on every VM instance, it may still not be enough for application to be completely ready to take on production traffic.

Try enabling Application Initialization Module to completely warm up your application prior to swapping it into production.

Check this: How to warm up Azure Web App during deployment slots swap



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@SnehaAgrawal-MSFT I solved it by scaling from a P2V2 to a P3V2 before my deploy, warm up and swap steps And as a last step I'm scaling down again. This makes it run smooth.

0 Votes 0 ·