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.
What you're looking for is Azure App Service auto healing. There are two different types that you'll want to consider.
You can get to these options through your app service's "Diagnose and solve problems" blade.
It's under "diagnostic tools".