webapp scale out

ares 206 Reputation points
2025-01-28T10:56:49.16+00:00

Hi

i have a web app service plan with webapp and with functions, i need to autoscale, since there is the function automatic scaling is not available, so i need to configure custom autoscale with rules, i need to scale from one instance to two instances immediately when cpu is over 30%, what is the best config? Screenshot 2025-01-28 113703

the scale increase must be as fast as possible then after the spike i need to scale down for the rest of the day to 1 instance.

with this config it doesn't scale down do i have to add a separate rule fro scale down by one instance?

thanks

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,067 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Laxman Reddy Revuri 2,315 Reputation points Microsoft Vendor
    2025-01-29T09:00:19.5033333+00:00

    Hi @ares
    Thanks for the question and using MS Q&A platform.
    Scaling up rules looks mostly correct so let's optimize it for Good:

    Metric: CPU Percentage, Operator: Greater than, Threshold: 30%, Duration: 1 minute (This is good for quick response), Grain: 1 minute, cool down: 1 minute, Operation: Increase count by, Instance count: 1

    You will need to add a second rule for scaling down:

    Metric: CPU Percentage, Operator: Less than, Threshold: 30%, Duration: 10 – 15 minutes (To avoid flapping), Grain: 1 minute, cool down: 5 minutes, Operation: decrease count by, Instance count: 1

    Important additional settings:

    In the instance limit section (not visible in the image), ensure to set: Min 1 Max 2 Default 1

    Yes, you do need to add a separate rule for scaling down. The current configuration only handles scaling up. Without a scale-down rule, the service will stay at the higher instance count indefinitely.
    The scale down rule is designed to allow for a longer period before cooling down to reduce the chances of the system scaling down too fast due to brief spikes on the CPU. This avoids the situation where you are constantly scaling up and down, a phenomenon commonly referred to as flapping.
    references:
    https://learn.microsoft.com/en-us/azure/app-service/manage-automatic-scaling?utm_source=chatgpt.com&tabs=azure-portal
    https://learn.microsoft.com/en-us/azure/azure-monitor/autoscale/autoscale-get-started?utm_source=chatgpt.com
    Please accept as "Yes" if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.