您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

在 Azure App Service 中纵向扩展应用Scale up an app in Azure App Service

本文介绍如何在 Azure 应用服务中缩放应用。This article shows you how to scale your app in Azure App Service. 缩放的工作流有两种:纵向扩展和横向扩展;本文介绍纵向扩展工作流。There are two workflows for scaling, scale up and scale out, and this article explains the scale up workflow.

  • 纵向扩展:获取更多 CPU、内存、磁盘空间和额外功能,例如专用虚拟机 (VM)、自定义域和证书、过渡槽、自动缩放以及更多功能。Scale up: Get more CPU, memory, disk space, and extra features like dedicated virtual machines (VMs), custom domains and certificates, staging slots, autoscaling, and more. 可以通过更改应用所属的应用服务计划的定价层来提升。You scale up by changing the pricing tier of the App Service plan that your app belongs to.
  • 横向扩展:增加用于运行应用的 VM 实例数。Scale out: Increase the number of VM instances that run your app. 最多可以向外缩放到 20 个实例,具体取决于定价层。You can scale out to as many as 20 instances, depending on your pricing tier. 独立层中的应用服务环境会进一步将横向扩展计数增加到 100 个实例。App Service Environments in Isolated tier further increases your scale-out count to 100 instances. 有关向外缩放的详细信息,请参阅手动或自动缩放实例计数For more information about scaling out, see Scale instance count manually or automatically. 可在该文中了解如何使用自动缩放,即根据预定义的规则和计划自动缩放实例计数。There, you find out how to use autoscaling, which is to scale instance count automatically based on predefined rules and schedules.

缩放设置仅需几秒即可应用,并且会影响应用服务计划中的所有应用。The scale settings take only seconds to apply and affect all apps in your App Service plan. 缩放设置不需要更改代码或重新部署应用程序。They don't require you to change your code or redeploy your application.

有关各个应用服务计划的定价和功能的信息,请参阅应用服务定价详细信息For information about the pricing and features of individual App Service plans, see App Service Pricing Details.

备注

在从免费层切换应用服务计划之前,必须首先删除对 Azure 订阅施加的支出限制Before you switch an App Service plan from the Free tier, you must first remove the spending limits in place for your Azure subscription. 若要查看或更改 Microsoft Azure 应用服务订阅的选项, 请参阅Microsoft Azure 订阅To view or change options for your Microsoft Azure App Service subscription, see Microsoft Azure Subscriptions.

向上缩放定价层Scale up your pricing tier

备注

要纵向扩展到 PremiumV2 层,请参阅为应用服务配置 PremiumV2 层To scale up to PremiumV2 tier, see Configure PremiumV2 tier for App Service.

  1. 在浏览器中,打开 Azure 门户In your browser, open the Azure portal.

  2. 在应用服务应用页的左侧菜单中, 选择 "纵向扩展 (应用服务计划) "。In your App Service app page, from the left menu, select Scale Up (App Service plan).

  3. 选择层, 然后选择 "应用"。Choose your tier, and then select Apply. 选择不同的类别 (例如, "生产"), 并查看其他选项以显示更多层。Select the different categories (for example, Production) and also See additional options to show more tiers.

    导航以纵向扩展 Azure 应用规模。

    操作完成后, 会看到一个通知弹出窗口, 其中包含绿色的 "成功" 复选标记。When the operation is complete, you see a notification pop-up with a green success check mark.

如果应用依赖于其他服务,如 Azure SQL 数据库或 Azure 存储,则可单独对这些资源进行纵向扩展。If your app depends on other services, such as Azure SQL Database or Azure Storage, you can scale up these resources separately. 这些资源不由应用服务计划管理。These resources aren't managed by the App Service plan.

  1. 在应用的 "概述" 页中, 选择 "资源组" 链接。In the Overview page for your app, select the Resource group link.

    与向上缩放 Azure 应用相关的资源

  2. 在 "资源组" 页的 "摘要" 部分中, 选择要缩放的资源。In the Summary part of the Resource group page, select a resource that you want to scale. 以下屏幕截图显示了 SQL 数据库资源。The following screenshot shows a SQL Database resource.

    导航到资源组页面对 Azure 应用进行纵向扩展

    若要纵向扩展相关资源, 请参阅特定资源类型的文档。To scale up the related resource, see the documentation for the specific resource type. 例如, 若要纵向扩展单个 SQL 数据库, 请参阅在 AZURE SQL 数据库中缩放单一数据库资源For example, to scale up a single SQL Database, see Scale single database resources in Azure SQL Database. 若要纵向扩展 Azure Database for MySQL 资源, 请参阅缩放 MySQL 资源To scale up a Azure Database for MySQL resource, see Scale MySQL resources.

比较定价层Compare pricing tiers

有关详细信息(例如每个定价层的 VM 大小),请参阅应用服务定价详细信息For detailed information, such as VM sizes for each pricing tier, see App Service Pricing Details.

有关服务限制、配额和约束的表以及每个层级所支持的功能,请参阅应用服务限制For a table of service limits, quotas, and constraints, and supported features in each tier, see App Service limits.

更多资源More resources

手动或自动缩放实例计数Scale instance count manually or automatically
为应用服务配置 PremiumV2 层Configure PremiumV2 tier for App Service