Scaled out Azure App Service too slow
Asked Answered
E

2

6

When I try to scale out my Azure Web App I experience very slow response times for requests on the second or third instance of the app. This seems to happen because the other instances were in cold mode and had to switch into hot mode once the load balancer redirected the request to them.

The problem is that in my scenario most of the time there isn't going on much on the system so probably only one instance will be used via the load balancer but approx four times a day there is a peak and I need more than one instance. But if these instances are in cold mode and had to wake up first it actually makes things worse.

The question is what to do?

I've already set the app to "always on" and ARR Affinity to "off".

In the past I've already experienced problems with my app going into some sort of sleep mode even though the app was set to "always on". I solved this by setting up a scheduler task that called the app every hour. But I don't think this would work with multiple instances anymore because the task would only call one instance and the other instances would still stay in sleep mode.

Any suggestions?

Emphasize answered 1/5, 2017 at 6:59 Comment(3)
Is the problem that cold instances are sluggish to respond initially, then run at acceptable speed when warmed up? Or do the instances remain sluggish?Scintilla
It is relatively hard to tell because I'm never sure which instance is responding. But at least it feels like the cold instances are only sluggish to respond initially.Emphasize
Here's docs on having Azure hit various URLs to warm up an instance during a slot swap: github.com/projectkudu/kudu/wiki/Understanding-site-swaps . I can't find definitive docs on exactly what happens when an instance is spun up during an auto-scale scale out. I'm guessing that this may be valid.Scintilla
P
1

increase your app service plan(S3) and try it again. I had similar problem and this solved it.

Alternatively, you can reconfigure your scaling rules.

Pons answered 19/9, 2022 at 8:55 Comment(0)
H
0

Consider enabling logging to debug which instances are receiving the requests and why these requests are slow.

For the comment around four times a day, you need more than once instance -- consider setting up Autoscale with recurrence profile on your app service plan to automatically scale out. You can setup autoscale rule with different instance counts based on the time of day.

Hypothesis answered 2/5, 2017 at 3:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.