1

Azure Dashboard

I've been having issues with Azure App Autoscale. The main instance (ends with YX) always gets overloaded no matter how many other instances I add.

When the app's average CPU reaches 60%, I add one more instance.

When the average response time gets high, the app becomes unresponsive.

I am able to resolve the issue from time to time by manually restarting the primary instance.

I leave Health Check enabled, but it never restarts the instance on its own, as it still has the Healthy status.

Is there a way to automatically restart ONE single instance when the CPU hits avg 90%?

... or maybe another way to better allocate the resources?

Thank you.

  • Graph 1: Avg CPU Percentage (all instances)
  • Graph 2: Avg Response Time (all instaces)
  • Graph 3: Active Instances
  • Graph 4: CPU Time by Instance
  • Graph 5: CPU Percentage by Instance
default
  • 551
  • 8
  • 16
  • 2
    The problem you should be investigating is "Why does my application become unresponsive at high load?" not "How do I put a band-aid on the issue by restarting it when it becomes unresponsive?" Basically, investigate and address the root cause, not the symptom. – Daniel Mann Mar 27 '23 at 18:16
  • @DanielMann The problem is the number of requests at peak times. Why aren't new requests destined for another instance? – default Mar 27 '23 at 18:20
  • *The problem is the number of requests at peak times* Do the metrics tell you that? It could be *some* requests use most CPU time and it is not about the volume of the requests. – Peter Bons Mar 27 '23 at 19:20

1 Answers1

2

What you're looking for is Azure App Service auto healing. There are two different types that you'll want to consider.

  1. Auto Heal allows you to set up mitigation actions based on what conditions are present in your app. You define conditions and actions to take when those conditions are present. There isn't a condition for CPU usage, but there are for request duration, memory limits, request counts, and status codes. You can address your problem by setting auto-heal rules based on these other metrics.

enter image description here

  1. The second option is proactive auto-heal. Proactive auto-heal will monitor your entire application and restart it if it determines that it's in a "bad state" based on memory usage and request time.

enter image description here

You can get to these options through your app service's "Diagnose and solve problems" blade.

enter image description here

It's under "diagnostic tools".

enter image description here

Narthring
  • 1,124
  • 18
  • 32