常见自动缩放模式的概述Overview of common autoscale patterns

本文介绍一些常见模式,这些模式可在 Azure 中缩放资源。This article describes some of the common patterns to scale your resource in Azure.

Azure Monitor 自动缩放仅适用于虚拟机规模集云服务应用服务 - Web 应用API 管理服务Azure Monitor autoscale applies only to Virtual Machine Scale Sets, Cloud Services, App Service - Web Apps, and API Management services.

入门Lets get started

本文假定使用者熟悉自动缩放。This article assumes that you are familiar with auto scale. 可以开始在此处缩放资源You can get started here to scale your resource. 下面是一些常见缩放模式。The following are some of the common scale patterns.

基于 CPU 进行缩放Scale based on CPU

拥有 Web 应用(/VMSS/云服务角色)并且You have a web app (/VMSS/cloud service role) and

  • 要基于 CPU 进行扩大/缩小。You want to scale out/scale in based on CPU.
  • 此外,你希望确保实例数最小。Additionally, you want to ensure there is a minimum number of instances.
  • 同时,希望确保为可以扩展到的实例数设置最大限制。Also, you want to ensure that you set a maximum limit to the number of instances you can scale to.

基于 CPU 进行缩放

在工作日与周末以不同方式缩放Scale differently on weekdays vs weekends

拥有 Web 应用(/VMSS/云服务角色)并且You have a web app (/VMSS/cloud service role) and

  • 默认情况下想要 3 个实例(在工作日)You want 3 instances by default (on weekdays)
  • 不希望在周末有流量,因此希望在周末减少到 1 个实例。You don't expect traffic on weekends and hence you want to scale down to 1 instance on weekends.

在工作日与周末以不同方式缩放

在节假日期间以不同方式缩放Scale differently during holidays

拥有 Web 应用(/VMSS/云服务角色)并且You have a web app (/VMSS/cloud service role) and

  • 希望在默认情况下基于 CPU 使用率扩展/缩减You want to scale up/down based on CPU usage by default
  • 但是,在节假日(或对于业务来说非常重要的特定日子)期间你想要覆盖默认值,并希望有更多容量可供支配。However, during holiday season (or specific days that are important for your business) you want to override the defaults and have more capacity at your disposal.

在节假日以不同方式缩放

基于自定义指标进行缩放Scale based on custom metric

有一个 Web 前端和一个可与后端通信的 API 层。You have a web front end and an API tier that communicates with the backend.

  • 想要基于前端中的自定义事件缩放 API 层(示例:想要基于购物车中的项目数缩放结帐进程)You want to scale the API tier based on custom events in the front end (example: You want to scale your checkout process based on the number of items in the shopping cart)

基于自定义指标进行缩放