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

向上缩放 Azure 中的应用Scale up an app in Azure

备注

与现有定价层相比,新的 PremiumV2 层提供更快的 CPU 和 SSD 存储以及双倍的内存-内核比。The new PremiumV2 tier gives you faster CPUs, SSD storage, and double the memory-to-core ratio than the existing pricing tiers. 要纵向扩展到 PremiumV2 层,请参阅为应用服务配置 PremiumV2 层To scale up to PremiumV2 tier, see Configure PremiumV2 tier for 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、内存、磁盘空间和额外功能,例如专用虚拟机 (VMs)、自定义域和证书、暂存槽、自动缩放以及更多功能。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 do not 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

  1. 在浏览器中,打开 Azure 门户In your browser, open the Azure portal.
  2. 在应用服务应用页面,单击“所有设置”,然后单击“纵向扩展”。In your App Service app page, click All settings, and then click Scale Up.

    导航到向上缩放 Azure 应用。

  3. 选择层,并单击“选择”。Choose your tier, and then click Select.

    在操作完成后,“通知”选项卡上将闪现绿色的成功字样。The Notifications tab will flash a green SUCCESS after the operation is complete.

如果应用依赖于其他服务,如 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 are not managed by the App Service plan.

  1. 在“软件包”中,单击“资源组”链接。In Essentials, click the Resource group link.

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

  2. 在“资源组”页的“摘要”部分,单击希望缩放的资源。In the Summary part of the Resource group page, click a resource that you want to scale. 以下屏幕截图显示了 SQL 数据库资源和 Azure 存储资源。The following screenshot shows a SQL Database resource and an Azure Storage resource.

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

  3. 对于 SQL 数据库资源,请单击“设置” > “定价层”以缩放定价层。For a SQL Database resource, click Settings > Pricing tier to scale the pricing tier.

    向上缩放 Azure 应用的 SQL 数据库后端

    还可以为 SQL 数据库实例启用异地复制You can also turn on geo-replication for your SQL Database instance.

    对于 Azure 存储资源,请单击“设置” > “配置”以向上缩放存储选项。For an Azure Storage resource, click Settings > Configuration to scale up your storage options.

    向上缩放 Azure 应用使用的 Azure 存储帐户

比较定价层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.

备注

如果想要在注册 Azure 帐户之前开始使用 Azure 应用服务,请转到试用应用服务,可以通过该页面在应用服务中立即创建一个生存期较短的入门 Web 应用。If you want to get started with Azure App Service before you sign up for an Azure account, go to Try App Service where you can immediately create a short-lived starter web app in App Service. 不需要使用任何信用卡,也无需做出任何承诺。No credit cards are required and there are no commitments.

后续步骤Next steps