question

VolodymyrBilyachat-6989 avatar image
0 Votes"
VolodymyrBilyachat-6989 asked ·

Azure web app autoscaler is sending traffic to new node before it is ready

I have my web app which using s1 plan and I have autoscaling rules 70216-autoscaler.png

So now the problem is each time app is scaled OUT my app is basically down for good 5-10 minutes.


Long time ago i started on this problem and added
<applicationInitialization doAppInitAfterRestart="true" skipManagedModules="false">
<add initializationPage="/api/warmup" />
</applicationInitialization>


So this fixed my problem so when i do new deployment and Swap slots app is alive during that.

So facing issues with scaling i read that app service has now health status

70243-autoscaler.png

But that did not help me too, but i noticed that since i have url rewrite to redirect http -> https, so i thought oh yes thats my problem and i fixed that few days ago, but again today my app died again and I am really disappointed since i dont have any other ideas what is wrong.

<rule name="No redirect on warmup request (request from localhost with warmup user agent)"
stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{REQUEST_URI}" pattern="^/api/warmup" />
<add input="{REQUEST_URI}" pattern="^/health-status" />
</conditions>
<action type="Rewrite" url="{URL}" />
</rule>

Only one thing which helps is scale up to S2 so each node starts faster but again then i will need to pay more for those resources.....


azure-webappsazure-webapps-scaling
autoscaler.png (111.6 KiB)
autoscaler.png (134.0 KiB)
10 |1000 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.

ajkuma-MSFT avatar image
0 Votes"
ajkuma-MSFT answered ·

@VolodymyrBilyachat-6989, Apologies for the delay and any frustration with this issue.

To get to the root of this issue in a quick time, I wish to engage with you offline for a closer look and provide a specialized assistance, so I'm follow-up with you privately.

If you haven't done this already, kindly set the WEBSITE_ADD_SITENAME_BINDINGS_IN_APPHOST_CONFIG=1 app setting on all slots.
-After slot swaps, the app may experience unexpected restarts. This is because after a swap, the hostname binding configuration goes out of sync, which by itself doesn't cause restarts. However, certain underlying storage events (such as storage volume failovers) may detect these discrepancies and force all worker processes to restart. See this doc.

Thanks for the detailed description of the issue and your time.


· 1 ·
10 |1000 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.

@VolodymyrBilyachat-6989 ,

Just to highlight on Scaling instances and slots under App Service Plan (ASP):

When you create an app in App Service, it is put into an App Service plan. When the app runs, it runs on all the VM instances configured in the App Service plan.
If multiple apps are in the same App Service plan, they all share the same VM instances. If you have multiple deployment slots for an app, all deployment slots also run on the same VM instances. If you enable diagnostic logs, perform backups, or run WebJobs, they also use CPU cycles and memory on these VM instances.

In this way, the ASP is the scale unit of the App Service apps.
Example:
If the plan is configured to run five VM instances, then all apps in the plan run on all five instances.
If the plan is configured for autoscaling, then all apps in the plan are scaled out together based on the autoscale settings.





0 Votes 0 ·
ajkuma-MSFT avatar image
0 Votes"
ajkuma-MSFT answered ·

To update/from our offline discussion:

VolodymyrBilyachat-6989 was able to narrow-down the problem further, it was due to huge timeout setting for SQL. Scaling-out in such cases, would be helpful.

@VolodymyrBilyachat-6989, thanks for the follow-up and sharing the solution that worked for you.


To benefit the community find the right answers, please do mark the post which was helpful by clicking on ‘Accept Answer’ & ‘Up-Vote’.

·
10 |1000 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.