Rediģēt

Kopīgot, izmantojot


How to configure auto scaling for a Cloud Service (classic) in the portal

Important

Cloud Services (classic) is now deprecated for all customers as of September 1st, 2024. Any existing running deployments will be stopped and shut down by Microsoft and the data will be permanantly lost starting October 2024. New deployments should use the new Azure Resource Manager based deployment model Azure Cloud Services (extended support).

You can set conditions for a cloud service worker role to trigger scale in or out operations. The conditions for the role can be based on the CPU, disk, or network load of the role. You can also set a condition based on a message queue or the metric of some other Azure resource associated with your subscription.

Note

This article focuses on Cloud Service (classic). When you create a virtual machine (classic) directly, it is hosted in a cloud service. You can scale a standard virtual machine by associating it with an availability set and manually turn them on or off.

Considerations

You should consider the following information before you configure scaling for your application:

  • Core usage affects scaling.

    Larger role instances use more cores. You can scale an application only within the limit of cores for your subscription. For example, say your subscription has a limit of 20 cores. If you run an application with two medium-sized cloud services (a total of four cores), you can only scale up other cloud service deployments in your subscription by the remaining 16 cores. For more information about sizes, see Cloud Service Sizes.

  • You can scale based on a queue message threshold. For more information about how to use queues, see How to use the Queue Storage Service.

  • You can also scale other resources associated with your subscription.

  • To enable high availability of your application, you should ensure it deploys with two or more role instances. For more information, see Service Level Agreements.

  • Auto Scale only happens when all the roles are in Ready state.  

Where scale is located

After you select your cloud service, you should have the cloud service blade visible.

  1. On the cloud service blade, on the Roles and Instances tile, select the name of the cloud service.
    IMPORTANT: Make sure to select the cloud service role, not the role instance that is below the role.

    Screenshot of the Roles and instances tile with the Worker Role With S B Queue 1 option outlined in red.

  2. Select the scale tile.

    Screenshot of the Operations page with the Sale tile outlined in red.

Automatic scale

You can configure scale settings for a role with either two modes manual or automatic. Manual is as you would expect, you set the absolute count of instances. Automatic however allows you to set rules that govern how and by how much you should scale.

Set the Scale by option to schedule and performance rules.

image Cloud services scale settings with profile and rule

  1. An existing profile.
  2. Add a rule for the parent profile.
  3. Add another profile.

Select Add Profile. The profile determines which mode you want to use for the scale: always, recurrence, fixed date.

After you configure the profile and rules, select the Save icon at the top.

Profile

The profile sets minimum and maximum instances for the scale, and also when this scale range is active.

  • Always

    Always keep this range of instances available.

    Cloud service that always scale

  • Recurrence

    Choose a set of days of the week to scale.

    Cloud service scale with a recurrence schedule

  • Fixed Date

    A fixed date range to scale the role.

    CLoud service scale with a fixed date

After you configure the profile, select the OK button at the bottom of the profile blade.

Rule

Rules are added to a profile and represent a condition that triggers the scale.

The rule trigger is based on a metric of the cloud service (CPU usage, disk activity, or network activity) to which you can add a conditional value. Additionally you can have the trigger based on a message queue or the metric of some other Azure resource associated with your subscription.

Screenshot of the Rule dialog box with the Metric name option outlined in red.

After you configure the rule, select the OK button at the bottom of the rule blade.

Back to manual scale

Navigate to the scale settings and set the Scale by option to an instance count that I enter manually.

Cloud services scale settings with profile and rule

This setting removes automated scaling from the role and then you can set the instance count directly.

  1. The scale (manual or automated) option.
  2. A role instance slider to set the instances to scale to.
  3. Instances of the role to scale to.

After you configure the scale settings, select the Save icon at the top.