升级和缩放 Azure API 管理实例Upgrade and scale an Azure API Management instance

客户可通过添加和删除单位来缩放 Azure API 管理实例。Customers can scale an Azure API Management instance by adding and removing units. “单位”由专用的 Azure 资源构成,具有以每月 API 调用次数表示的承载容量。A unit is composed of dedicated Azure resources and has a certain load-bearing capacity expressed as a number of API calls per month. 此数字不表示调用限制,而是粗略容量规划允许的最大吞吐量值。This number does not represent a call limit, but rather a maximum throughput value to allow for rough capacity planning. 实际吞吐量和延迟因多种因素而异,例如并发连接的数量和速率、配置策略的类型和数量、请求和响应大小以及后端延迟。Actual throughput and latency vary broadly depending on factors such as number and rate of concurrent connections, the kind and number of configured policies, request and response sizes, and backend latency.

每个单位的容量和价格取决于该单位所在的“层”。Capacity and price of each unit depends on the tier in which the unit exists. 可以在以下四个层中进行选择:开发人员基本标准高级You can choose between four tiers: Developer, Basic, Standard, Premium. 如果需要提高层中服务的容量,应添加单位。If you need to increase capacity for a service within a tier, you should add a unit. 如果当前在 API 管理实例中选择的层不允许添加更多单位,则需要升级到更高级别的层。If the tier that is currently selected in your API Management instance does not allow adding more units, you need to upgrade to a higher-level tier.

每个单位的价格和可用的功能(例如多区域部署)取决于为 API 管理实例选择的层。The price of each unit and the available features (for example, multi-region deployment) depends on the tier that you chose for your API Management instance. 定价详细信息一文介绍了每个单位的价格,以及每个层提供的功能。The pricing details article, explains the price per unit and features you get in each tier.

Note

定价详细信息一文说明了每个层中单位容量的大致数字。The pricing details article shows approximate numbers of unit capacity in each tier. 若要获取更准确的数字,需要分析所用 API 的实际方案。To get more accurate numbers, you need to look at a realistic scenario for your APIs. 请参阅 Azure API 管理实例的容量一文。See the Capacity of an Azure API Management instance article.

先决条件Prerequisites

若要执行本文中的步骤,必须:To follow the steps from this article, you must:

可用性Availability

Important

此功能在 API 管理的“高级”、“标准”、“基本”和“开发人员”层中可用。This feature is available in the Premium, Standard, Basic and Developer tiers of API Management.

升级和缩放Upgrade and scale

可以在以下四个层中进行选择:“开发人员”、“基本”、“标准”和“高级” 。You can choose between four tiers: Developer, Basic, Standard, and Premium. 应将“开发人员”层用于评估服务;不应将其用于生产。The Developer tier should be used to evaluate the service; it should not be used for production. “开发人员”层不附带 SLA,无法缩放此层(添加/删除单位)。The Developer tier does not have SLA and you cannot scale this tier (add/remove units).

“基本”、“标准”和“高级”是附带 SLA 的生产层,可以缩放 。Basic, Standard, and Premium are production tiers that have SLA and can be scaled. “基本”层是附带 SLA 的最便宜层,最多可以扩展 2 个单位,“标准”层最多可以扩展到四个单位 。The Basic tier is the cheapest tier with an SLA and it can be scaled up to two units, Standard tier can be scaled to up to four units. 可将任意数目的单位添加到“高级”层。You can add any number of units to the Premium tier.

使用“高级”层可在任意数目的所需 Azure 区域中分配单个 Azure API 管理实例。The Premium tier enables you to distribute a single Azure API Management instance across any number of desired Azure regions. 最初创建 Azure API 管理服务时,实例仅包含一个单位,并驻留在单个 Azure 区域中。When you initially create an Azure API Management service, the instance contains only one unit and resides in a single Azure region. 初始区域被指定为“主要”区域。The initial region is designated as the primary region. 可以轻松添加更多区域。Additional regions can be easily added. 添加区域时,需指定想要分配的单位数。When adding a region, you specify the number of units you want to allocate. 例如,可在“主要”区域中包含一个单位,在另外某个区域中包含五个单位。For example, you can have one unit in the primary region and five units in some other region. 可以定制用于处理每个区域中的流量的单位数。You can tailor the number of units to the traffic you have in each region. 有关详细信息,请参阅如何将 Azure API 管理服务实例部署到多个 Azure 区域For more information, see How to deploy an Azure API Management service instance to multiple Azure regions.

可在任意两个层之间来回升级和降级。You can upgrade and downgrade to and from any tier. 升级或降级可能会删除某些功能,例如,从“高级”层降级到“标准”或“基本”层时,会删除 VNET 或多区域部署。Upgrading or downgrading can remove some features - for example, VNETs or multi-region deployment, when downgrading to Standard or Basic from the Premium tier.

Note

升级或缩放过程可能需要 15 到 45 分钟才能完成。The upgrade or scale process can take from 15 to 45 minutes to apply. 完成时会收到通知。You get notified when it is done.

Note

“消费”层中的 API 管理服务会根据流量自动缩放。API Management service in the Consumption tier scales automatically based on the traffic.

缩放 API 管理服务Scale your API Management service

在 Azure 门户中缩放 API 管理服务

  1. Azure 门户导航到 API 管理服务。Navigate to your API Management service in the Azure portal.
  2. 从菜单中选择“位置”。Select Locations from the menu.
  3. 单击要缩放的位置所在的行。Click on the row with the location you want to scale.
  4. 指定新的“单位数” - 使用滑块或键入数字。Specify the new number of units - either use the slider or type the number.
  5. 单击“应用” 。Click Apply.

更改 API 管理服务层Change your API Management service tier

  1. Azure 门户导航到 API 管理服务。Navigate to your API Management service in the Azure portal.
  2. 单击菜单中的“定价层”。Click on the Pricing tier in the menu.
  3. 从下拉列表中选择所需服务层。Select the desired service tier from the dropdown. 更改后,使用滑块指定 API 管理服务的规模。Use the slider to specify the scale of your API Management service after the change.
  4. 单击“保存” 。Click Save.

纵向扩展和纵向缩减过程中的停机时间Downtime during scaling up and down

若要从开发人员层缩放或缩放到开发人员层,将会出现停机时间。If you are scaling from or to the Developer tier, there will be downtime. 否则,不会出现停机时间。Otherwise, there is no downtime.

后续步骤Next steps